~/talk

Safely Migrating to DataStore in Production

TalkinJapaneseat DroidKaigi 2022 · 2022-10-05..10-07· [android, databases]
speakerdeck:takahana
slides:none on file

How to migrate Android apps from SharedPreferences to Jetpack Preference DataStore: create a singleton DataStore (Hilt recommended), provide a repository interface, and convert consumers to Kotlin Flow or offer Java-compatible wrappers (Rx/blocking). Perform key-by-key migrations using the SharedPreferences migration with a specific key set, test real upgrade paths and duplicate-key handling, and avoid large one-shot releases because reverting a migration can silently drop preferences written after migration.

AI-written summary · about

  1. 0:00Introduction
  2. 0:21DataStore overview
  3. 3:55Migration motivation
  4. 8:32SharedPreferences vs DataStore
  5. 9:16Migration steps
  6. 15:19Java calls handling
  7. 20:15Testing before and after
  8. 25:31Summary
~/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.