SQLiteDatabase.openDatabase vs SQLiteOpenHelper.getReadableDatabase

Is there a difference between the two methods? Both return an open SQLiteDatabase. Both can create a database if it does not exist. SQLiteOpenHelper also has getWriteableDatabase when read / write is required ...

Which method should I use and where? Based on the code sample I saw, I use SQLiteOpenHelper to create my database first, but then call SQLiteDatabase.openDatabase when I need to use the database.

+7
source share
1 answer

openDatabase() more flexible, allowing you to specify the language, etc., but for most cases when you do not need to explicitly provide this data, the Android documentation says use getReadableDatabase() and getWriteableDatabase() .

+3
source

All Articles