Repository: A class that you create, for example using the is lifecycle aware.UI components just observe relevant data and don't stop or resume observation.The Room persistence library creates and maintains this database for you. When you use a DAO, you call the methods, and Room takes care of the rest.Room database: Database layer on top of SQLite database that takes care of mundane tasks that you used to handle with an .
For a sample, destroying and re-creating the database is a fine migration strategy.
Off-topic concepts and code are provided for you to simply copy and paste.
This codelab provides all the code you need to build the complete app.
For a real app, you must implement a migration strategy. A Repository is a class that abstracts access to multiple data sources.
The Repository is not part of the Architecture Components libraries, but is a suggested best practice for code separation and architecture. It provides a clean API to the rest of the app for app data.