Elements of Android Room


Storing data locally is a key part of many Android apps. SQLite is built into Android, but the low-level API that the Android SDK provides is a bit clunky to use.

Google’s solution for that is Room, an object wrapper around that API. This gives us a cleaner, type-safe, reactive API for our database operations. Room is part of the Android Jetpack, and so it is a key element of Google’s recommended “stack” of technologies for building Android apps.

This book explores Room, starting with basic stuff like:

  • Adding Room to your app

  • Defining your entities and data access operation (DAO) APIs

  • Testing your database I/O

  • Using Room with Kotlin coroutines, LiveData, and RxJava

  • Migrating your database schema as your app evolves

It also gets into more elaborate scenarios, such as using SQLCipher for Android for encrypting your Room database.

This book is published in PDF, EPUB, and MOBI/Kindle formats, for use in your favorite digital book reader. Or, read directly in your Web browser on the Warescription site, complete with full-text searching.

Subscribe for $20 »

The Table of Contents

Each bullet shown below represents a chapter. Use the search field in the nav bar to search all of the CommonsWare books to see what they hold!

  • Room Basics
  • The Dao of Entities
  • Room and Custom Types
  • Room and Reactive Frameworks
  • Relations in Room
  • The Support Database API
  • Database Migrations
  • Polymorphic Entities
  • Default Values and Partial Entities
  • Room and Full-Text Search
  • Room and Conflict Resolution
  • A Room With a View
  • Room and PRAGMAs
  • Packaged Databases
  • Backing Up Your Room
  • SQLite Clients
  • SQLCipher for Android
  • SQLCipher and Passphrases
  • Managing SQLCipher
  • Paged Room Queries
  • What’s New in Room?
profile for CommonsWare at Stack Overflow, Q&A for professional and enthusiast programmers

What's New

  • New chapter on database views
  • New chapter on what’s new in Room 2.3.0
  • Updated chapter on Room paging, showing Paging 3

Details

Spread the Word!