卸载或强制从设置清除数据后为Android应用保存数据 [英] Data save for an android app after it uninstall or force data clear from settings

查看:620
本文介绍了卸载或强制从设置清除数据后为Android应用保存数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在用户首次安装应用程序时给他们一些信息(但我希望它针对特定设备).这意味着,如果他卸载并重新安装,他将再也无法理解这一点.我发现了以下方法:

I want to give the user some point when they first install the app (but I want it to device specific). It means if he uninstalls and re-installs he will not get that point again. I have found below methods:

  1. 将设备先前的数据保留在共享的首选项中,如果我发布应用程序的更新,这些数据将被删除

  1. Keep device previous data in shared preferences which will be deleted if I release an updates of the app

将以前的数据存储在sql数据库中,但是如果用户从设置中清除数据,则它将丢失

Store previous data in sql database but if user clears data from settings it will be lost

在SD卡存储数据中创建一个文件,并使用.foldername将其保存在文件夹中并检查文件值,问题是用户可以将其删除

Create a file in SDcard store data, saving that file in a folder with .foldername and check the file value, problem is that the user can delete it

每次用户打开应用程序时,它都会向服务器发送设备ID,服务器会在分配积分之前检查它是否已存储.问题是应该避免服务器维护.

Every time the user opens the app it sends device id to server, server will check it is previously stored or not before giving point. Problem is that server maintenance should be avoided.

除了这3种方法外,还有其他方法吗? 你能以其他方式建议我吗? 还是可以告诉我是否有其他方法对3和4更好?

Other than these 3 methods is there any other method? Can you suggest me any other way, or can you please tell me if there is no other method which would be better for 3 and 4?

推荐答案

版本4. 使用 Google的备份服务器,但是用户可以通过以下方式删除数据他的系统设置.

Variation of 4. using Google's backup servers, however the user can delete the data through his system settings.

这篇关于卸载或强制从设置清除数据后为Android应用保存数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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