LiveData is a data holder class found in the Jetpack
Room is built to work with LiveData.
Since you already included the
lifecycle-extensions library in your app/build.gradle file in Chapter 4, you have access to the LiveData class in your project.
LiveData’s goal is to simplify passing data between different parts of your application, such as from your CrimeRepository to the fragment that needs to display the crime data. LiveData also enables passing data between threads. This makes it a perfect fit for respecting the threading rules we laid out above.
When you configure queries in your Room DAO to return LiveData, Room will automatically execute those query operations on a background ...