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.plutolib.plugins:rooms-db:$plutoVersion"
releaseImplementation "com.plutolib.plugins:rooms-db-no-op:$plutoVersion"
}
Now to start using the plugin, add it to Pluto
Pluto.Installer(this)
.addPlugin(PlutoRoomsDatabasePlugin())
.install()
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.
To open Rooms Database plugin screen via code, use this
Pluto.open(PlutoRoomsDatabasePlugin.ID)