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:
- Room
- LiveData
- 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 ...