


ViewModel instances survive device configuration changes. ViewModel : Provides data to the UI and acts as a communication center between the Repository and the UI. Repository: A class that you create for managing multiple data sources, for example using the WordRepository class. The Room database uses the DAO to issue queries to the SQLite database. Room database: Database layer on top of SQLite database that takes care of mundane tasks that you used to handle with a helper class, such as SQLiteOpenHelper. When you use a DAO, you call the methods, and the components take care of the rest. You used to have to define these queries in a helper class, such as SQLiteOpenHelper. The Room persistence library creates and maintains this database for you.ĭAO: Data access object. For simplicity, additional storage options, such as a web server, are omitted from this chapter. SQLite database: On the device, data is stored in an SQLite database. This diagram shows a basic form of this architecture.Įntity: When working with Architecture Components, the entity is an annotated class that describes a database table.

Each component is explained more in the following sections. To introduce the terminology, here is a short introduction to the Architecture Components and how they work together.

Architecture Components provide a simple, flexible, and practical approach that frees you from some common problems so you can focus on building great experiences. Android Architecture Components provide guidance on app architecture, with libraries for common tasks like lifecycle management and data persistence.Īrchitecture Components help you structure your app in a way that is robust, testable, and maintainable with less boilerplate code. The Android OS manages resources aggressively to perform well on a huge range of devices, and sometimes that makes it challenging to build robust apps. What are Android Architecture Components? What are Android Architecture Components?.Lesson 3: Testing, debugging, and using support libraries
