Skip to content

Most visited

Recently visited

added in API level 1


Contains the SQLite database management classes that an application would use to manage its own private database.

Applications use these classes to manage private databases. If creating a content provider, you will probably have to use these classes to create and manage your own database to store content. See Content Providers to learn the conventions for implementing a content provider. If you are working with data sent to you by a provider, you do not use these SQLite classes, but instead use the generic android.database classes.

The Android SDK and Android emulators both include the sqlite3 command-line database tool. On your development machine, run the tool from the platform-tools/ folder of your SDK. On the emulator, run the tool with adb shell, for example, adb -e shell sqlite3.

The version of SQLite depends on the version of Android. See the following table:

Android APISQLite Version
API 273.19
API 263.18
API 243.9
API 213.8
API 113.7
API 83.6
API 33.5
API 13.4

Some device manufacturers include different versions of SQLite on their devices. There are two ways to programmatically determine the version number.

  • If available, use the sqlite3 tool, for example: adb -e shell sqlite3 --version.
  • Create and query an in-memory database as shown in the following code sample:
        String query = "select sqlite_version() AS sqlite_version";
        SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(":memory:", null);
        Cursor cursor = db.rawQuery(query, null);
        String sqliteVersion = "";
        if (cursor.moveToNext()) {
            sqliteVersion = cursor.getString(0);


SQLiteCursorDriver A driver for SQLiteCursors that is used to create them and gets notified by the cursors it creates on significant events in their lifetimes. 
SQLiteDatabase.CursorFactory Used to allow returning sub-classes of Cursor when calling query. 
SQLiteTransactionListener A listener for transaction events. 


SQLiteClosable An object created from a SQLiteDatabase that can be closed. 
SQLiteCursor A Cursor implementation that exposes results from a query on a SQLiteDatabase
SQLiteDatabase Exposes methods to manage a SQLite database. 
SQLiteDatabase.OpenParams Wrapper for configuration parameters that are used for opening SQLiteDatabase  
SQLiteDatabase.OpenParams.Builder Builder for SQLiteDatabase.OpenParams
SQLiteOpenHelper A helper class to manage database creation and version management. 
SQLiteProgram A base class for compiled SQLite programs. 
SQLiteQuery Represents a query that reads the resulting rows into a SQLiteQuery
SQLiteQueryBuilder This is a convience class that helps build SQL queries to be sent to SQLiteDatabase objects. 
SQLiteStatement Represents a statement that can be executed against a database. 


SQLiteAbortException An exception that indicates that the SQLite program was aborted. 
SQLiteAccessPermException This exception class is used when sqlite can't access the database file due to lack of permissions on the file. 
SQLiteBindOrColumnIndexOutOfRangeException Thrown if the the bind or column parameter index is out of range  
SQLiteConstraintException An exception that indicates that an integrity constraint was violated. 
SQLiteDatabaseCorruptException An exception that indicates that the SQLite database file is corrupt. 
SQLiteDatabaseLockedException Thrown if the database engine was unable to acquire the database locks it needs to do its job. 
SQLiteDiskIOException An exception that indicates that an IO error occured while accessing the SQLite database file. 
SQLiteDoneException An exception that indicates that the SQLite program is done. 
SQLiteException A SQLite exception that indicates there was an error with SQL parsing or execution. 
SQLiteFullException An exception that indicates that the SQLite database is full. 
SQLiteMisuseException This error can occur if the application creates a SQLiteStatement object and allows multiple threads in the application use it at the same time. 
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


在 WeChat 上追蹤 Google Developers

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)