sebastianf182
sebastianf182

Reputation: 9978

Android: Using SQLiteOpenHelper. Should I use a ContentProvider?

I am developing an Android application.

So far I've created my own SQLiteOpenHelper as a singleton and a synchronized getInstance().

I am not sure if I should be also using a ContentProvider. I understand that Android uses it to match the Activity that should open my Intent, but should I be using it in my application?

What sort of direct advantages could I have if I use one? I am starting the application and I would love to use as much best practices as I can.

Can I add it later? I can't seem to fully understand the function of these ContentProviders.

Thanks!

Upvotes: 2

Views: 953

Answers (1)

Femi
Femi

Reputation: 64710

You only really need to bother with a ContentProvider if you intend to syndicate your content to an external application (for example, if you want your content to used as an email attachment, or you want a third party application to access your data). Otherwise if you'll just be using the data from within your application stick with a local SQLite instance.

Upvotes: 5

Related Questions