I bundled a database with my app in the assets folder. At the first activity, I copy the database to the correct location perfectly (no problem here).
my question; is it better to use openDatabase (String path, SQLiteDatabase.CursorFactory factory, int flags) or to use getWritableDatabase method of the SQLiteOpenHelper class?
which is more efficient? I'm accustomed to using the getWritableDatabase method, which requires passing of Context, but I just feel I can do without it since I don't need the onUpgrade or onCreate function of the SQliteOpenHelper.
getWritableDatabase is just SQLiteOpenHelper's way of opening databases.
If you do not need SQLiteOpenHelper, the you do not need to call getWritableDatabase either.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With