Open 4shutosh opened 3 years ago
Hey, may I work on this?
Thank you for your interest @xtanion.
Priority: Bugs > Enhancements
Please try to solve one of the bugs floating around first. (good-first-issue && bug) If you cannot yes, you may go ahead and start working on this issue.
Thanks for the suggestions @4shutosh, I'll look for good-first-issue
that I can solve ;).
I would like to work on this issue for now, can you please assign it to me?
This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.
@gouri-panda @mhutti1 Do you confirm that SharedPreferences is really deprecated? Do you confirm that using Jetpack DataStore is the most appropriate replacement?
@kelson42 SharedPreferences
hasn't been deprecated yet. But we think it'll be deprecated soon with the alternative of DataStore
. DataStore
offers many things that SharedPreference
lacks. It's a very good idea to replace and use it now.
@gouri-panda Thank you for your feedback. I have a bit difficulties to judge how difficult and how much work would be needed. Do you have a few hints/answers?
@kelson42 In a nutshell we have SharedPreferenceUtil
class which lets store all the default key
and value
and we use it over all the functions and tests in our project. We'll be adding a new implementation of DataStore
and There'll be some code refactoring in both functions and tests as well. I think it's a little big.
I can work on this, and I guess it will be a lengthy task, I think it's would be better if we discuss this out before implementing it.
Please feel free to list down your questions here @shankarpriyank
@4shutosh One major thing I have in mind is that, will there not be a migration problem? Like we have different ways to manage migrations of databases in room, do we something like that in this case? Cause let's assume a user has the app with the previous version(with shared preferences installed) and then he updated the app to the datastore version, will that not cause an inconsistency? Maybe break the app too?
@gouri-panda @4shutosh @shankarpriyank Considering that:
Is your feature request related to a problem? Please describe.
SharedPreferences are used for storing key-value pairs in local storage, which is now deprecated.
Describe the solution you'd like
Jetpack DataStore Preferences should be used instead of shared preferences A good article explaining the benefits is here. Its stable version is out, and can be implemented in our app.
Additional context
Files to be modified mainly includes
SharedPreferenceUtil
for implementing the DataStore