9
Chapter 9: Using Room with
Google's Architecture
Components
By Aldo Olivares
In
the previous chapters, you learned how to create the most important components
of a Room Database: your
data access objects (DAOs)
and your
entities
.
While having your DAOs and entities is usually enough
to interact with your
database, you still need a way to display all the information to the user, all the while
handling lifecycle of the app and configuration changes. This is where Google's
architecture
components such as the
ViewModel
and
LiveData
come to the rescue!
In this chapter, you will learn:
• What
LiveData
and
ViewModel
components are, and how to use them.
• How
to make your DAOs return
LiveData
s instead of simple data objects.
• How to create
ViewModel
s that are
Do'stlaringiz bilan baham: