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

未关闭
#26 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
20/100
Issue 类型
重构
描述清晰度
需要澄清
活跃度
停滞
技术栈
android, kotlin
领域
mobile-dev

调研方向

首先检查现有的 Shared Preferences 使用情况以及 Jetpack Proto Data Store 迁移指南。issue 提到了一个 .proto 定义、一个 Serializer 和一个 Flow 对象,但没有指定文件、测试或入口点。要完成此项工作,需要就 300 多个 preferences 的迁移方案达成一致。

由索引模型根据 Issue 内容生成。

描述

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 ?

主要语言
Kotlin
星标
242
派生
115
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

android/codelab-android-datastore 的其他 Issue

查看 android/codelab-android-datastore 的全部 Issue

相似的 Issue

更多 Kotlin Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。