Note App using MVVM and Room Database in Android Studio Using Java
The components which we will be using inside the application are listed below with a detailed explanation :
LiveData: Live Data is a data holder class that can be observed. It holds as well as caches the latest version of the data and notifies our observer whenever the data is being updated or changed. Live Data automatically manages all of this since it is aware of the relevant lifecycle status changes while observing.
ViewModel: View Modal acts as a communication center between repository and UI. The UI no longer needs to worry about the origin of the data. The ViewModel instances survive Activity/Fragment recreation.
Repository: Repository is a class that is mainly used to manage multiple sources of data.
Entity: Entity is an annotated class that is used to describe a database table when we are working with Room.
Room Database: Room Database is an improvised version of SQLite Database. It simplifies the database work and serves as an access point to the underlying SQLite database. The room uses DAO to issue queries to the SQLite database.
DAO: DAO is a Data Access Object which is used for mapping SQL queries to functions.