The android Jetpack team recently released the DataStore library (still in alpha) as a way of saving simple data using two implementations:
- Preference DataStore has similar functions to SharedPreferences and used to store simple key-value pairs..
- Proto DataStore is used for storing custom data types and requires creating a schema.
Rather than use DataStore, why don't we use sharedPreferences for simple datatypes and Room for more complex storage.
What are the BENEFITS OF USING DATASTORE IN ANDROID OVER USING SHAREDPREFERNCES (for simple data) + ROOM (for complex data).
quoting after Florina Mutanescu