I'm new to Android development. I'm trying to create an application that reads from the internal database (SQLite) and list all the data in a list (I'm using listView
).
So far I got a class called DatabaseHandler
that extends SQLiteOpenHelper
and that is doing all the database operations (select data, insert data, delete data, ...).
But now that I want to list the values, I am reading in some websites that I have to use a Loader
instead of Cursor
, and therefore a ContentProvider
. So far I understand that ContentProvider
provides controlled access to the database.
My question is: does the ContentProvider
do the same as SQLiteOpenHelper
?
Also, I'm using API level 8 and the ContentProvider
is only available on API level 11. What is the best way to solve this?
Thanks in advance.