Sharing my Preference for DataStore
summary
DataStore replaces SharedPreferences with two implementations — Preferences DataStore for primitive key/value pairs and Proto DataStore for typed protocol buffer objects — built on Kotlin coroutines and Flow. It provides atomic read‑modify‑write operations, signals IO errors via exceptions, runs writes on Dispatchers.IO so UI thread stays responsive, and supports migrations from SharedPreferences (requires a migration‑done flag). Current release is alpha and requires a protobuf serializer for proto stores.
AI-written summary · about
chapters (12)
- 0:00Introduction to DataStore
- 0:57Problems with SharedPreferences
- 4:29Why choose DataStore
- 5:12Preferences DataStore demo
- 7:57Writing data with DataStore
- 9:23Migrating from SharedPreferences
- 10:26Proto DataStore crash course
- 13:13Writing to Proto DataStore
- 14:37Proto DataStore migration
- 16:25Multiple DataStore instances
- 17:27DataStore advantages
- 19:36Q&A session
related talks
27mSharing my preference for DataStore
30mDataStore Preferences and migrating from SharedPreferences
19mJetpack DataStore - protocol buffers storage solution
25mThe New Modern Data Persistence on Android - Meet Jetpack Datastore
26mSafely Migrating to DataStore in Production
34mStoring app data reliably & performantly with SimpleStore
39mUnidirectional data flow on Android using Kotlin
24mLightweight Realtime & Offline Data Storage on Android without a Database
