pushtorefresh / storio

Reactive API for SQLiteDatabase and ContentResolver.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ContentResolver vs SQLite?

nayeemzen opened this issue · comments

Is there any advantage of using one or the other if you don't intend on sharing the data outside of your own application? You still get change notifications with both right?

Hi, @nayeemzen !
There are the same differences as android ContentResolver has against raw SQLiteOpenHelper, except notifications.
StorIOSQLite also sends change notifications.
So if you don't want to share data between applications or wrap existing ContentResolver to rx-ify it's notifications, StorIOSQLite will be easier and more preferably

Usually you only need ContentProvider when you want to share your data with other apps or with other process instances of your app, otherwise direct use of SQLite is preferred since it does not add overhead and StorIO has more features for StorIOSQLite and low level control over things than for StorIOContentResolver.

Damn, @nikitin-da! Just a second faster than me!!11

Thanks so much guys! ContentResolver is so much boilerplate.