android / android/codelab-android-datastore

Migrate to Jetpack Proto Data Store from Shared Preferences when you have more than 300 Preferences in your android app?

Open
#26 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Kotlin
Stars
240
Forks
113
PR merge metrics
No merged PRs in 30d

Description

Shared Preferences are used heavily into my application, they are more than 300s of every possible data types such as int, boolean, String etc etc.

Now I want to migrate into Jetpack Proto Data store, the all the tutorials which I have tried define all the preferences into .proto file and then retrieve the data from Data Store and provides a FLOW object of the class in which all possible preferences are defined.

The class structure which I define into proto, is used to create Serializer as well into Flow object of the retrieved value, so my QUESTION is,

**Do I need to define all the 300+ preferences into a single file first and then use them (It would require me to lots of code to write into each places wherever shared prefs is used) OR is there any better way of migration ?**

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing Shared Preferences usage and the Jetpack Proto Data Store migration guidance. The issue mentions a .proto definition, a Serializer, and a Flow object, but names no files, tests, or entry points. Done would require an agreed migration approach for the 300+ preferences.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.