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.
startmanagingcursor(cursor)
it says it's deprecated. Also I keep reading that loaders are better due to the data synchronization issues... – GlitterAlso, I'm using API level 8 and the ContentProvider is only available on API level 11. What is the best
not true ...Loader
s are from API 11 but we have support library v4 ...ContentProvider
s are from API 1 :) – Doorn