【发布时间】:2014-11-06 20:58:25
【问题描述】:
我正在开发一组需要共享通用状态和配置设置的复杂 Android 应用程序。
例如,看这张解释我的场景的图片:
我希望 APP 1、APP 2 和 APP 3 能够访问(读/写)公共存储区域的数据。 此外,我需要卸载保护,即我不希望在用户卸载任何应用程序时删除数据。
我已经阅读了有关 SQLite 数据库、ContentProviders 以及在内部和外部存储上的写作,但上述每种方法都有如下所列的缺点:
- SQLite 数据库:DB 在应用卸载时被删除,并且对每个应用都是私有的
- ContentProvider:移除带有 ContentProvider 的应用时,数据被移除
- 内部存储:每个应用程序都是私有的,数据在应用程序卸载时被删除 (http://developer.android.com/training/basics/data-storage/files.html#InternalVsExternalStorage)
- 外部存储:不可靠(用户可以移除 SD 卡)
- 存储在服务器上:不可能,用户可能没有可靠的互联网连接
编辑:
我不希望对 Google Play 服务有任何依赖,因为我将通过 Play 商店分发应用程序并作为第 3 方下载。
请帮帮我。
【问题讨论】:
-
External storage: Is unreliable (user may remove SD card)。错误观念。在大多数设备上,外部存储器是内置的。如果您添加一个微型 SD 卡,那么它就是可移动存储器,但通常称为外部存储器。 -
你能解决这个问题吗?
-
你找到解决这个问题的方法了吗?
标签: android sqlite android-contentprovider android-external-storage