安卓:保存文件永久(即​​使经过清晰的数据/卸载) [英] Android: Save file permanently (even after clear data / uninstall)

查看:270
本文介绍了安卓:保存文件永久(即​​使经过清晰的数据/卸载)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一种方法来存储少量数据的永久。
通过永久我的意思是我想即使用户清除应用程序数据/卸载应用程序中的数据持久化。
我知道,共享preferences和数据库,当用户清除应用程序数据/卸载应用程序都将被删除。

I would like to know if there is a way to store a small amount of data permanently.
By permanently I mean I want the data to persist even if user clears app data / uninstalls app.
I know that shared preferences and databases are deleted when user clears app data / uninstalls app.

我也知道,我可以节省的东西在SD卡,但是如果设备没有SD卡/ SD卡是卸载?

I also know that I can save stuff on SD Card, but what if device does not have SD Card / SD Card is unmounted?

我认为最好的办法是,以节省设备内存中的数据,但有可能做到这一点没有得到清除时,应用程序数据删除的数据/卸载应用程序?

I think that the best option would be to save the data on device internal memory, but is it possible to do that without getting the data deleted when clears app data / uninstalls app?

推荐答案

您不应该这样做,你不应该强迫用户保持在手机上的数据未经其同意。

You shouldn't do that, you shouldn't force the users to keep data on their phones without their consent.

总之,应用程序数据目录将被卸载后删除,但不是以后的更新

Anyway, application data directory will be deleted after uninstall, but NOT after an update

有持久性数据的唯一方法是使用SD卡,但同样的,用户不会喜欢有自己的卡中的数据的应用程序卸载后,

The only way to have persistent data is to use the SD card, but again, users won't like to have the data on their card after the app is uninstalled

或者你也可以考虑:

  1. 存储在远程服务器与某些种类的认证上的数据检索
  2. 使用数据备份服务

这篇关于安卓:保存文件永久(即​​使经过清晰的数据/卸载)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆