Managing SQLite Connections in Android Managing SQLite Connections in Android android android

Managing SQLite Connections in Android


Connection opening in SQLite is about 0.2ms.

The best practice tells us to open and close the connection each time we need one.


Just use SQLiteOpenHelper.getReadableDatabase() and SQLiteOpenHelper.getWriteableDatabase() - Android will manage and cache the connection so you don't need to.

In fact, refer to the official Google Using Databases documentation:

To write to and read from the database, call getWritableDatabase() and getReadableDatabase(), respectively. These both return a SQLiteDatabase