

Along with that, we will be also able to add a new note to your app. We will be building a simple Notes Application in which we will be displaying the list of notes in Recycler View which is added by the user. What we are going to build in this article? DAO: DAO is a Data Access Object which is used for mapping SQL queries to functions.The room uses DAO to issue queries to the SQLite database. It simplifies the database work and serves as an access point to the underlying SQLite database. Room Database: Room Database is an improvised version of SQLite Database.Entity: Entity is an annotated class that is used to describe a database table when we are working with Room.Repository: Repository is a class that is mainly used to manage multiple sources of data.The ViewModel instances survive Activity/Fragment recreation. The UI no longer needs to worry about the origin of the data. ViewModel: View Modal acts as a communication center between repository and UI.Live Data automatically manages all of this since it is aware of the relevant lifecycle status changes while observing. It holds as well as caches the latest version of the data and notifies our observer whenever the data is being updated or changed. LiveData: Live Data is a data holder class that can be observed.The components which we will be using inside the application are listed below with a detailed explanation : We can get to see the explanation of each component in detail.

In this article, we will be specifically looking at components such as LiveData, ViewModel, and Room. In this article, we will specifically take a look at using a Room Database with Architecture Components in Android. All the data storing techniques are having different use cases. ISRO CS Syllabus for Scientist/Engineer ExamĪndroid provides us a feature with which we can store users’ data inside their mobile itself with different storage options such as Shared Preferences, SQLite database, and the Room Database.ISRO CS Original Papers and Official Keys.GATE CS Original Papers and Official Keys.
