You can associate more than one table with a ContentProvider. You can
even associate more than one database with a single ContentProvider
instance, but considering the amount of extra programming work you'd
encounter, it's best not to.

I'm not sure why you'd want to associate more than one database with a
single ContentProvider. Are you trying to save memory by not having
multiple instances of a ContentProvider? I think that would be a waste
of time and effort, without much gain.

Remember, too, that you don't need to use a ContentProvider in order
to access an SQLite database. ContentProvider is primarily designed to
provide a unified _cross-application_ data source. If you have a local
SQLite database or databases that you don't want to share outside your
application, you can use the android.sqlite.* classes directly.

The examples always use one table because that's the most simple
example.

On Aug 24, 9:01 am, Arpit <[email protected]> wrote:
> Hi All,
>
> All the example codes, tutorials or video I see, there is always one
> ContentProvider per SQL Table with the SQLiteOpenHelper extension
> defined as a private static class...
>
> Is it some sort of standard design...to have one ContentProvider per
> SQL Table? Or I can define one generic ContentProvider and use its
> instance for ever update?
>
> Is there some issue with that?
>
> Could anyone please help as my application has like 5-6 tables.
>
> Regards,
> Arpit

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to