I read this article https://medium.com/@ianhlake/hidden-gems-of-android-o-7def63136629 . This is what is written there:
SharedPreferences is dead. Long live SharedPreferences.
Will SharedPreferences
keep working in Android O ? Do we need to implement own mechanism for storing data in key value pairs by implementing PreferenceDataStore
Can anyone help how would be approach to implement new SharedPreferences
using PreferenceDataStore
& What is use case of developing own implementation ? Any drawback in current approach ?
You should abandon bad habit of judging the book by its cover and instead of drawing conclusions from just catchy chapter title, simply read the mentioned post fully.
Shared Preferences are not even deprecated in Android Oreo and what Ian Lake mentions is an improvement, which allows your app to keep the same simple key/value pair API as it has now, but additionally be able to provide your own implementation of data store for said data (i.e. in Firebase, remote server, etc). If you do not need that, then you can simply use Shared Preferences as you did so far w/o any change in your code and with such use case nothing really changed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With