I could use a little bit of help understanding ContentProviders
Problem:
- I’ve got a list of entities (
Strings) which should be displayed in an activity. - The information are provided by third party apps. And are only valid as long as the application is running.
- Each app will get its own activity to display their data.
Solution:
- I provide a
ContentProvider.
Question:
Do I have to use a DB as underlying persistence? As an alternative I could use a plain ArrayList<String> to store the entities and use separate ContentProvider for each application.
The reason I’m asking is that the complete interface and infrastructure seams to be focused to transport persistent data with use of DBs. So I’m wondering whether I misuse the framework.
Thanks in advance.
No, you definitely do not need to use a Database — you are free to implement whatever storage mechanism you want (or lack of). Most of the time, however, it seems you’ll have a backing database in your application so things are persisted.