Reputation: 24474
Is it possible to successfully use Sqlite on Android without also having to use a ContentProvider?
Can someone show me a sample that doesn't use ContentProvider?
And if it is indeed true that Sqlite can be successfully used without it, what are examples of cases where ContentProvider would be necessary?
Upvotes: 2
Views: 2211
Reputation: 2069
You need to be aware that SQLite database isn't thread safe, so if you intend to have more than the one thread running at any time accessing the database, you'll definitely run into more problems than in implementing a ContentProvider
.
I strongly recommend having a ContentProvider
as you can bake all the difficult SQL that cannot be mapped to ContentProvider queries into URIs instead.
Upvotes: 1
Reputation: 5022
This site does an excellent job describing how to use SQLite in Android without managing to ever once use the term 'ContentProvider.'
A simple Google search such as Android SQLite tutorial -"ContentProvider"
will show many many more examples.
Google is your friend.
Upvotes: 2