Introducing Jetpack Room
Modern applications should be available for use in any conditions, including when the user is missing an internet connection. This allows apps to provide a seamless user experience and usability even when the user's device cannot access the network.
In this section, we will discuss the following:
- Exploring the caching mechanism on Android
- Introducing Jetpack Room as a solution for local caching
So, let's begin!
Exploring the caching mechanism on Android
To cache specific content or application data, reliable Android apps make use of the various offline caching mechanisms that are suitable for different use cases:
- Shared preferences are used to store lightweight data (such as user-related selections) as key-value pairs. This option shouldn't be used to store objects that are part of the app's content.
- Device storage (either internal or external) is used for storing heavyweight data (such as files, pictures...