In my app I want to show a list of apps that I have placed in an resource file.
I parse the XML(resource) file and then save the value in a SQLiteDatabase
. I have implemented my Database inside a ContentProvider
. What I want to know is do I need a Custom CursorLoader (should I extend CursorLoader
?)? or will CursorLoader
itself will be sufficient. I have seen an example, but in this no ContentProvider
has been used.
Can someone explain when should I implement a Custom CursorLoader as against using the original one?
(A little unrelated) Also what would be the best practice, to implement a database with or without a ContentProvider
?
Thanks in Advance!
There are many ways to implement it -
ContentProvider
there is no need to extend the CursorLoader
.ContentProvider
and using a SQLiteDatabase
instead, we can extend the CursorLoader
with our Custom-Loader and override the loadInBackground()
method of CursorLoader
and instead of querying the ContentProvider
we can query the SQLiteDatabase
.SQLiteDatabase
we can extend AsyncTaskLoader
, however, this is more