Tech Takeaways

Get the latest insights and how-to’s into the world of Android and Backend development

Member-only story

A First Look At The New Android Room Gradle Plugin

3 min readOct 11, 2023

--

Photo by Matthew Ansley on Unsplash

Android Room is the official Object-Relation-Mapping (ORM) solution for using SQL Light databases within your Android app.

To ensure that we can track our database schema version over new App updates and also be able to use the auto-migration feature introduced with version 2.4.0, we had to make sure that we use the annotation processor API of the Kotlin Symbol Processor (KSP) or KAPT respectively to declare the export location for our Room schema files.

Those schemata then got automatically exported as a JSON file into the declared folder so we could check them into the version control system of our choice. Inside the app-level build.gradle.kts file, an ordinary schema location declaration then mostly looked like the following:

ksp {
arg("room.schemaLocation", "$projectDir/schemas")
}

However, with the version 2.6.0-alpha02 of Android Room, a new artifact was introduced: The new Room Gradle Plugin! The plugin addresses issues tied to Room schemas' inputs and outputs via Gradle annotation processor options.

In a nutshell, this plugin ensures that the generated schemas used for auto-migrations and produced during compile tasks are set up correctly for reproducible and

--

--

Tech Takeaways
Tech Takeaways

Published in Tech Takeaways

Get the latest insights and how-to’s into the world of Android and Backend development

Yanneck Reiß
Yanneck Reiß

Written by Yanneck Reiß

Follow me on my journey as a professional mobile and fullstack developer

No responses yet