0

What are the main differences between using content providers and using direct queries on sqlite? My application doesn't share data with another apps is still good for me to use content providers

1 Answers1

-1

ContentProvider is more generalized version, duplicating CRUD operations from db. It also support multithreading by default. You should definetely use ContentProvider, moreover, there is opensource libraries, authomatically generating content provider based on your schema, see: https://github.com/BoD/android-contentprovider-generator as example. You can create db schema fast (without writing boilerplate query code). And, also, there is ContentObserver, which will notify your app whenever data is changed ( the same, as QueryListener in Realm)

Alex Shutov
  • 3,217
  • 2
  • 13
  • 11