Reference

Jetpack DataStore

Jetpack DataStore is the modern Android API for storing small amounts of key-value or typed data asynchronously, using Kotlin coroutines and Flow. It is Google's recommended replacement for SharedPreferences.

Android developmentAndroid

Jetpack DataStore

Also known as: datastore android, preferences datastore, android datastore, proto datastore

Jetpack DataStore is the modern Android API for storing small amounts of key-value or typed data asynchronously, using Kotlin coroutines and Flow. It is Google's recommended replacement for SharedPreferences.

  • DataStore is Google's recommended replacement for SharedPreferences.
  • It ships in two forms: Preferences (key-value) and Proto (typed) DataStore.
  • Its files live in private internal app storage and count as app data, not cache.

What Jetpack DataStore is

Jetpack DataStore is a data-storage solution in Android Jetpack that persists small datasets such as user settings, feature flags, and lightweight app state. It comes in two flavors: Preferences DataStore, which stores untyped key-value pairs, and Proto DataStore, which stores strongly typed objects defined with a Protocol Buffers schema.

Unlike the older SharedPreferences API, DataStore is fully asynchronous. Reads and writes happen off the main thread via Kotlin coroutines and expose changes as a Flow, so the UI observes updates reactively. It also reports errors through exceptions and handles transactional writes safely, avoiding the silent failures and main-thread I/O that plagued SharedPreferences.

How it stores data on disk

Preferences DataStore persists data as a file under the app's private files directory (typically in the datastore subfolder of the app's internal storage), while Proto DataStore serializes its typed schema to a binary file. Because these files live in internal app storage, they count toward the app's data footprint rather than its cache.

DataStore is meant for small data only. It is not a database replacement, so large or relational datasets belong in SQLite/Room instead. When developers misuse it for big payloads, the backing files can grow and contribute to app data that users see in Settings > Apps.

Why it matters for storage and cleanup

DataStore files are persistent app settings, not disposable junk, so a storage cleaner should never treat them like clearable cache. Wiping them is the equivalent of resetting an app's preferences. This is the key distinction between an app's settings store and its app cache, which can be regenerated and safely removed.

Cleanor focuses on reclaiming space from regenerable caches, duplicates, and large media rather than from small settings stores like DataStore, which protects your in-app configuration while still freeing meaningful space.

Related terms

Keep reading the reference.

Act on it

Guides and tools for this topic.