【问题标题】:How to save data in private and can't be deleted by clear data in settings如何将数据私下保存,设置中清除数据无法删除
【发布时间】:2017-11-17 08:27:26
【问题描述】:

我知道有几种方法可以保存 Google 推荐的 Android 应用程序数据,例如 SharePreference、SQLite、Storage data-storage

但是,一旦用户在设置中清除应用程序详细信息中的数据,这些方法存储的数据将被删除。

我更喜欢将数据保存在 Settings.Global 或 Settings.Secure 中,但我不知道这是否可行,正如 API 所说:“应用程序可以读取这些但不允许写入 ”。

    /**
 * Global system settings, containing preferences that always apply identically
 * to all defined users.  Applications can read these but are not allowed to write;
 * like the "Secure" settings, these are for preferences that the user must
 * explicitly modify through the system UI or specialized APIs for those values.
 */
public static final class Global extends NameValueTable {

【问题讨论】:

  • 如果您告诉我们您要存储哪些数据以及它的敏感程度会更好
  • 保存用户设置的密码等数据,其他使用用户手机的用户无法删除。

标签: android data-persistence


【解决方案1】:

只需将日期保存在存储在 sdcard 中的文件中 https://developer.android.com/guide/topics/data/data-storage.html#filesExternal

【讨论】:

  • 我不认为这是我要找的。有几个字段值要存储,好像没有方便的API来存储和检索数据,我需要确认天气有没有sdcard。
猜你喜欢
  • 1970-01-01
  • 2014-06-12
  • 2012-12-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-05-22
  • 1970-01-01
相关资源
最近更新 更多