Android Persist Data After Uninstall(Android 卸载后保留数据)
问题描述
即使在卸载应用程序后,我也必须为我的应用程序保留 2 个字符串.关于最终用户的设备没有 SD 卡并且他们没有互联网连接,即使在应用程序卸载后我怎么能保留这 2 个字符串?
I have to persist 2 strings for my application even after the application is uninstalled. Regarding that the end users don't have SD cards for their devices and they don't have internet connection, how could I persist those 2 strings even after the app is uninstalled?
我将非常感谢任何回应.谢谢
I would highly appreciate any response. Thanks
推荐答案
除非您的目标是非常旧的手机,否则您无需担心没有外部存储.只要您使用 Environment.getExternalStorageDirectory()
作为参考,您应该没有问题,但如果您对此非常担心,您可以检查外部存储是否不存在并且然后选择去内部存储.查看开发者文档中的此链接以获得更多信息一个>.
Unless you're targeting VERY old phones, you don't need to worry about not having external storage. As long as you use Environment.getExternalStorageDirectory()
as your reference, you shouldn't have a problem, though if you're absolutely concerned about this you can check if the external storage doesn't exist and then opt to go to internal storage. Check out this link from the developer docs for a little more insight.
如果 External 确实不可用,您可以保存到 Internal memory,但您必须为此声明一个新权限,这可能会阻止某些人.
If External truly isn't available, you could then save to Internal memory, but you will have to declare a new permission for that, which may ward off some people.
这篇关于Android 卸载后保留数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Android 卸载后保留数据
- android 4中的android RadioButton问题 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01