androidx.datastore integration
See original GitHub issueThe Android team is quietly working on a SharedPreferences replacement called datastore. It’d be nice to have a module that wraps that, once it’s ready. An interesting wrinkle is that it has fully coroutine-based APIs so it’s going to be non-trivial to wrap with the existing Settings
interface.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (5 by maintainers)
Top Results From Across the Web
App Architecture: Data Layer - DataStore - Android Developers
Jetpack DataStore is a data storage solution that allows you to store key-value pairs or typed objects with protocol buffers.
Read more >New way of storing data in Android — Jetpack DataStore
The new way of storing data in Android — Jetpack DataStore ... It can be integrated with LiveData , RxJava , and Coroutine...
Read more >Deep Dive Into Preferences Datastore in Android
Google introduces Datastore as a replacement for shared preferences. Datastore is a data storage solution for storing small datasets in ...
Read more >Jetpack DataStore in Android - GeeksforGeeks
Jetpack DataStore is a data storage solution that uses protocol buffers to store key-value pairs or typed objects. DataStore stores data ...
Read more >Saving Data on Android, Chapter 5: Jetpack DataStore
DataStore is Google's new library to persist data as key-value pairs or typed objects using protocol buffers. Using Kotlin coroutines and Flow as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
My current thinking is to have both
FlowSettings
andSuspendSettings
interfaces, and converters between them and the standardSettings
andObservableSettings
. AnySettings
implementation can be wrapped toSuspendSettings
pretty easily, butFlowSettings
can only wrap aroundObservableSettings
because you need to set a listener to be able to get new updates in itsFlow
s. There would beDataStore
implementations of both, so you could use the one that fits your use-case better depending on what other implementations you need interop with.I want to have a version of this ready in the near future as part of 0.7
Flow would be nice (there’s a prototype in #37 of wrapping flows around the existing listeners) but I’m leaning toward suspend fun by default so that commonality with non-observable implementations (in particular, JS) is easier. Still need to do more thinking and prototyping though.