Google is committed to advancing racial equity for Black communities. See how.

Room Persistence Library   Part of Android Jetpack.

The Room persistence library provides an abstraction layer over SQLite to allow for more robust database access while harnessing the full power of SQLite.

The library helps you create a cache of your app's data on a device that's running your app. This cache, which serves as your app's single source of truth, allows users to view a consistent copy of key information within your app, regardless of whether users have an internet connection.

To use Room in your app, add the following dependencies to your app's build.gradle file:

dependencies {
  def room_version = "2.2.5"

  implementation "$room_version"
  annotationProcessor "$room_version" // For Kotlin use kapt instead of annotationProcessor

  // optional - Kotlin Extensions and Coroutines support for Room
  implementation "$room_version"

  // optional - RxJava support for Room
  implementation "$room_version"

  // optional - Guava support for Room, including Optional and ListenableFuture
  implementation "$room_version"

  // Test helpers
  testImplementation "$room_version"

Further documentation

For a guide on applying Room's capabilities to your app's data storage persistence solution, see the Room training guide.

Additional resources

To learn more about Room, consult the following additional resources.