我可以存储在Android设备上的数据的安装与坚持? [英] Can I store data on an Android device to persist between installs?

查看:93
本文介绍了我可以存储在Android设备上的数据的安装与坚持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要存储在它持续的应用程序安装的方式少量的数据。我显然不能使用共享preferences,因为他们是在卸载移除。有什么办法来存储数据,因此它生存的应用程序的重新安装?

I want to store a small amount of data in a way where it persists between application installs. I obviously can't use SharedPreferences as they are removes upon uninstallation. Is there any way to store data so it survives a reinstall of the app?

我要存储的数据是一个唯一的ID,允许应用程序的用户的阻塞,如果他们胡作非为。如果我不能存储一个ID,我可以访问谷歌帐户的电子邮件地址,将其作为一项指标?

The data I want to store is a unique ID, to allow blocking of users of the app if they misbehave. If I cannot store an ID, can I access the Google account(s) email addresses to use them as an indicator?

本博客文章讲清楚没有操作系统产生有什么好处,特别是考虑到在片中的ID 安卓识别应用程序的安装

This blog post makes it clear none of the IDs the OS produces are any good, especially when considering tablets Android: Identifying app installations

推荐答案

您可以存储在共享preferences数据并使用的备份管理器让它们自动备份。他们应该恢复,一旦应用程序被重新安装。

You can store the data in shared preferences and use a backup manager to have them backed up automatically. They should be restored once the app is reinstalled.

有阻塞某些人的app没有真正的方法。你可以脱颖而出所有用户创建一个帐户使用的应用程序,并阻止帐户,但他们总是可以重新创建一个帐户。你可以存放东西的SD卡和检查,但恶意用户可以找到并删除它。你可以尝试让用户将​​自己与他们的谷歌帐户对您的应用程序进行身份验证( andlytics 使用这样的身份验证方法),但用户可以恢复出厂设置他的电话,并创建一个新的谷歌帐户。

There is no real way of blocking the app for certain persons. You could fore all your users to create an account to use the app and block the accounts but they always can recreate an account. You could store something on the SD-Card and check for it but malicious users can find that and delete it. You could try to get the user to authenticate themselves with their google account against your app (andlytics is using an authentication method like that) but the user can factory reset his phone and create a new google account.

您必须选择有多么重要用户的阻塞是,你想惹恼,因为不使用你的应用程序如预期一些用户的其他用户有多少。

You have to choose how important the blocking of the users is and how much you want to annoy your other users because of some users that are not using your app as intended.

这篇关于我可以存储在Android设备上的数据的安装与坚持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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