Mohamed Ramadan
Mohamed Ramadan

Reputation: 485

Can I use a content resolver in my application without creating a provider?

I am reading the developer guide about the content providers and as it's mentioned there that I shouldn't create my own provider unless there is a need to.

So my questions are:

Upvotes: 0

Views: 149

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007359

Can I use content resolver in my application without creating my own provider?

You can use a ContentResolver with any other existing ContentProvider, such as those supplied by the OS (e.g., ContactsContract).

should I use always a content resolver (and create my own provider if necessary) to do all the operations with the DB or talking to SQLiteHelper class directly

There are differing opinions on that subject. Personally, I am not a big fan of ContentProvider, and so I only use it when I need to, such as for inter-process communication. However, there are those who think that using ContentProvider purely for internal use within an app is wonderful. There is no right or wrong answer.

Upvotes: 2

Related Questions