Sqlite

The androidx.sqlite library contains abstract interfaces along with basic implementations which can be used to build your own libraries that access SQLite.

You might want to consider using the Room library, which provides an abstraction layer over SQLite to allow for more robust database access while harnessing the full power of SQLite.

Latest Update Current Stable Release Next Release Candidate Beta Release Alpha Release
December 4, 2019 2.0.1 - 2.1.0-beta01 -

Declaring dependencies

To add a dependency on SQLite, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.

Add the dependencies for the artifacts you need in the build.gradle file for your app or module:

dependencies {
    def sqlite_version = "2.0.1"

    // Java language implementation
    implementation "androidx.sqlite:sqlite:$sqlite_version"

    // Kotlin
    implementation "androidx.sqlite:sqlite-ktx:$sqlite_version"

    // Implementation of the AndroidX SQLite interfaces via the Android framework APIs.
    implementation "androidx.sqlite:sqlite-framework:$sqlite_version"
}

For more information about dependencies, see Add build dependencies.

Version 2.1.0

Version 2.1.0-beta01

December 4, 2019

androidx.sqlite:sqlite:2.1.0-beta01, androidx.sqlite:sqlite-framework:2.1.0-beta01, and androidx.sqlite:sqlite-ktx:2.1.0-beta01 are released with no changes since 2.1.0-alpha01. Version 2.1.0-beta01 contains these commits.

Version 2.1.0-alpha01

November 7, 2019

androidx.sqlite:sqlite:2.1.0-alpha01, androidx.sqlite:sqlite-framework:2.1.0-alpha01, and androidx.sqlite:sqlite-ktx:2.1.0-alpha01 are released. Version 2.1.0-alpha01 contains these commits.

API changes

  • Added a new property to SupportSQLiteOpenHelper.Configuration called useNoBackupDirectory to indicate that a file based database should be created and located from the no backup directory.

Version 2.0.1

Version 2.0.1

March 13, 2019

Version 2.0.1 of the androidx.sqlite artifact group is released with two bug fixes.

Bug Fixes

  • Fixed two issues where FrameworkSQLiteOpenHelper wouldn’t properly recover from a corrupted database or a bad migration during initialization. (b/111504749 and b/111519144)