Skip to content Skip to sidebar Skip to footer

Two Content Providers Accessing The Very Same Database

Hi all! I wonder if there is a generally preferred implementation paradigm to respect if one want's two completely different Android applications to access and operate on the same

Solution 1:

Dbm,

Yes, it is accepted, encouraged and possible to do on Android. You do have a 3rd option (that will no doubt get me some burning commentary) and that's to put the ContentProvider (1) in an APK all of it's own. But, given that you only have 2 types, you can flip a quarter over which apk it is hosted by. I would choose the admin app, but that is subjective on my part.

If you are going to the trouble of creating two applications then you have "a priori" knowledge of what the behavior of each will do, and what kind of data that each can operate. Therefore I would conclude a single CP interface and just constrain what each app calls given the behavior you've described.

Frank

Post a Comment for "Two Content Providers Accessing The Very Same Database"