Skip to content

Files

rooms-database

Integrate Rooms Database Plugin in your application

Rooms.DB.Demo.webm

Add Gradle Dependencies

Pluto Rooms Database is distributed through mavenCentral. To use it, you need to add the following Gradle dependency to your build.gradle file of you android app module.

Note: add the no-op variant to isolate the plugin from release builds.

dependencies {
  debugImplementation "com.androidpluto.plugins:rooms-db:$plutoVersion"
  releaseImplementation "com.androidpluto.plugins:rooms-db-no-op:$plutoVersion"
}

Install plugin to Pluto

Now to start using the plugin, add it to Pluto

Pluto.Installer(this)
  .addPlugin(PlutoRoomsDatabasePlugin())
  .install()

Start watching Rooms Database

Create intance of DataStore Preferences and start watching in Pluto.

// DB_NAME should be same as database name assigned while creating the database.
PlutoRoomsDBWatcher.watch(DB_NAME, SampleDatabase::class.java)

🎉  You are all done!

Now re-build and run your app and open Pluto, you will see the Rooms Database plugin installed.


Open Plugin view programmatically

To open Rooms Database plugin screen via code, use this

Pluto.open(PlutoRoomsDatabasePlugin.ID)