Android BackupManager not restoring after uninstall or other devices?

▼魔方 西西 提交于 2019-12-24 13:16:05

问题


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.

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.


回答1:


As I know from the words of Android Advocate:

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.

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.



来源:https://stackoverflow.com/questions/13258075/android-backupmanager-not-restoring-after-uninstall-or-other-devices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!