卸载或其他设备后,Android BackupManager没有恢复? [英] Android BackupManager not restoring after uninstall or other devices?

查看:302
本文介绍了卸载或其他设备后,Android BackupManager没有恢复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 BackupManager 备份共享preferences 到云中。现在,这个工作当我使用它在单个设备上,只进行重新安装不完全卸载预期。要做到这一点,我清理这湿巾preFS数据和比月食重新安装应用程序。如果我先卸载应用程序,并重新安装它后恢复通话报告没有数据恢复。当我在其他设备上安装应用程序同样的情况。

I am using the BackupManager to backup SharedPreferences to the cloud. Now this works as expected when I use it on a single device and only perform a reinstall not a full uninstall. To do that I am clearing data which wipes prefs and than reinstalling the app from eclipse. If I first uninstall the app and after reinstall it the restore call reports no data to restore. The same happens when I install the app on another device.

从我的理解我希望将数据恢复到任何设备,无论应用程序被重新安装或者是一个新的安装。让我知道是否张贴code会帮助,但我想通了,因为它是工作,我可能只是误会了服务应该用于和它是如何工作。我想备份用户的设置,可能他们进入搜索字段的一些信息。我想这个数据跟随用户到一个新的设备,或者如果用户卸载应用程序,并在以后重新安装。请让我知道,如果 BackupManager 不是实现这一目标的正确工具。

From my understanding I would expect the data to be restored to any device regardless of the app being reinstalled or being a fresh install. Let me know if posting code will help but I figured that because it is working I might just have misunderstood what the service should be used for and how it works. I am trying to backup a users settings and possibly some information they enter into search fields. I would like this data to follow the user to a new device or if the user uninstalls the app and reinstalls at a later date. Please let me know if BackupManager is not the correct tool to accomplish this.

推荐答案

当我从Android的代言人的话,知道了:

As I know from the words of Android Advocate:

一般似乎 BackupManager 只为后盾可靠
  了以后要当应用程序在同一设备上恢复数据的应用程序
  从Play商店重新安装。

Generally it seems that BackupManager is only reliable for backing up app data that will later be restored on the same device if the app is re-installed from the Play Store.

如果你想要做跨多个设备的同步备份,那么你可以尝试使用谷歌云端硬盘API ,不是 BackupManager ,并且有从的关于这个问题谷歌I / O 2012。

If you want to do backup syncing across multiple devices then you can try to use Google Drive API, not BackupManager, and that there is very useful session from Google I/O 2012 on the subject.

这篇关于卸载或其他设备后,Android BackupManager没有恢复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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