I have to say it. Kotlin with Room is a breeze. It’s a delight. Sometimes a tool comes along and you just immediately feel the time savings (and bug saving) and you start texting you old co-workers and friends. That’s what Room’s been for me on a recent Android project.
It takes what might’ve taken a week i.e. setting up SQLite database, building data models, defining object relationships, and creating some helpers to access, save, delete data. And streamlines it into work that can be done in a day… at least for the initial setup. If you’ve worked with Android you’ve probably worked in Java. And you probably remember the days of Data Access Objects (DAOs). While mostly straightforward usage involved tons of boilerplate code, repetitive in nature and bug-prone. Not to mention the work of performance optimization and data migration.
Room streamlines all of this into a higher-level, object-oriented API. It uses compile-time annotation processing to help catch errors early, and integrates quickly and seamlessly with Android LiveData APIs. I won’t reinvent the wheel by way of tutorials and sample code — there’s plenty of getting started guides out there — but I’ll definitely add my +1 for these tools and how much time and effort they can save you.