Introduction

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

In this lesson, you’ll learn how to define a Room database. This lesson will include the purpose of a Room database, the components of a Room database, and how to create a database.

Room is part of the Android Jetpack libraries and provides an abstraction layer over SQLite. This allows for more robust database access while harnessing the full power of SQLite. Room provides compile-time checks of SQLite statements. It can return RxJava, Flowable, LiveData, or Kotlin Flow types for database queries.

Room also allows for the use of Data Access Objects (DAOs) to define the database interactions. Room’s use of DAOs makes it easier to work with databases in Android while writing less boilerplate code. Room uses code generation to generate the boilerplate code for you at compile time. Room also provides rich migration support to handle changes in the database schema.

Your key objectives for this lesson are:

  • Identify the purpose of a Room database.
  • Describe the components of a Room database.
  • Explain how to create a Room database.
See forum comments
Download course materials from Github
Previous: Quiz: Read & Write Files Next: Instruction