By using the search function I can't find anything...
# compose
l
By using the search function I can't find anything about
Shared Preferences
. Just the hint, that it's not the right data storage solution. I would like to save some settings. What's the right way to store such data persistently?
s
What kind of settings?
l
boolean, int (mainly flags) at least for now
s
Yep I'd use shared prefs for that kind of stuff
j
There has lately been a shift to Jetpack Datastore
2
👍 4
l
Are there any neat compose functions around that?
i
I don't think you need any new neat compose functions to call methods on Datastore or Shared Preferences. The section in the docs on calling a suspending method in an event listener would be all you'd need for Datastore's
suspend
methods: https://developer.android.com/jetpack/compose/lifecycle#remembercoroutinescope
l
Never used the api, thats why I was asking 🙂 Thanks guys