Room

Development and description of this section, in detail, including code snippets of how it is used in Zomato.

Room is a part of Android Architecture Components, which consists of three components:

  1. Room
  2. LiveData
  3. ViewModel

Room is a persistence library that provides an abstraction layer over the existing SQLite database. Room thus increases the security of the database, making it easier to access and also makes it easier to set up and access the new database. All the commands are now annotated, except the SELECT command that works with @Query.

To add room to our app, first we need to add the dependencies in the build.gradle file. First, we need to add the following to our project level build.gradle file:

buildscript {repositories {maven ...

Get Expert Android Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.