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:2.0.1-beta'
releaseImplementation 'com.plutolib.plugins:rooms-db-no-op:2.0.1-beta'
}
Now to start using the plugin, add it to Pluto
Pluto.Installer(this)
.addPlugin(PlutoRoomsDatabasePlugin("rooms-db"))
.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.