Mobile apps · Library

DataStore

Android's library for saving small bits of data such as settings, a theme choice or an onboarding flag, replacing the older SharedPreferences.

Android building blocks · Open source · updated

How it works

Preferences DataStore stores key-value pairs; Proto DataStore stores a typed object defined with Protocol Buffers. Both read and write asynchronously with coroutines and expose data as a Flow, so a settings screen updates as soon as a value changes and nothing blocks the main thread, a common cause of freezes with SharedPreferences.

Writes are transactional, so a crash halfway through cannot leave a corrupted file. It is meant for small data: anything with many records, relationships or queries belongs in Room. DataStore also works in Kotlin Multiplatform. It does not encrypt anything by itself, so tokens and other secrets should be encrypted with a key from the Android Keystore.

DataStore pricing

Open source

Free (Apache 2.0).

Approximate, checked September 2026.What the other tools cost

More in Mobile apps

Android building blocks

All 34 Mobile apps terms

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.