crbin1
crbin1

Reputation: 2229

How many ContentProvider?

In my application I access drectly to database through a SQLiteOpenHelper object.

Now I want to use ContentProviders. In the database I have 14 tables and 6 views. What is the best practice between the following?

  1. One Content Provider to access all tables and views

  2. One Content Provider for each tables and views (total 20 Content Providers)

  3. One Content Provider for each group of tables and views (totale 5/6 Content Providers)

Upvotes: 1

Views: 134

Answers (1)

Rajdeep Dua
Rajdeep Dua

Reputation: 11230

One content provider to access all the tables and views in a database. Content Provider is a abstraction for application to share data with other applications. One Content Provider for a database should be the approach.

Upvotes: 5

Related Questions