简体   繁体   中英

Android Sqlite without ContentProvider

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?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM