~/talk

Sharing my Preference for DataStore

Talkat droidcon EMEA 2020 · 2020-10-08..10-09· [android, kotlin]
slides:none on file

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

  1. 0:00Introduction to DataStore
  2. 0:57Problems with SharedPreferences
  3. 4:29Why choose DataStore
  4. 5:12Preferences DataStore demo
  5. 7:57Writing data with DataStore
  6. 9:23Migrating from SharedPreferences
  7. 10:26Proto DataStore crash course
  8. 13:13Writing to Proto DataStore
  9. 14:37Proto DataStore migration
  10. 16:25Multiple DataStore instances
  11. 17:27DataStore advantages
  12. 19:36Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.