Using DataStore to Store Data and Testing
Modern Android Development practices help Android developers create better applications. DataStore is a data storage solution provided by the Android Jetpack library. It allows developers to store key-value pairs or complex objects asynchronously and with consistency guarantees. Data is critical in Android development, and how we save and persist data matters. In this chapter, we will explore using DataStore to persist our data and look at best practices using DataStore.
In this chapter, we’ll be covering the following recipes:
- Implementing DataStore
- Adding Dependency Injection to DataStore
- Using Android Proto DataStore versus DataStore
- Handling data migration with DataStore
- Writing tests for our DataStore instance