1

I've created a sample project using BackupRestore. I went to register for a key at Android Backup Service. I got the following:

Your key is: AEdPqrEAAAAIW4p30C1GTNjzBOqWrb0clI7_OCWxm3ddIgkKhw This key is good for the app with the package name:

com.example.android.backuprestore Provide this key in your AndroidManifest.xml file with the following element, placed inside the <application> element:

<meta-data android:name="com.google.android.backup.api_key" android:value="AEdPqrEAAAAIW4p30C1GTNjzBOqWrb0clI7_OCWxm3ddIgkKhw" />

When I launch the app and choose "Bacon" + "Tomato", I can see pending backups using dumpsys backup. So I force run it (bgmr run => pendings disappear) and uninstall the app.

When I restore it, logcat tells me "No restore data available" and of course, the settings aren't displayed with the correct info.

Any ideas what I could be doing wrong ?

HitOdessit
  • 7,198
  • 4
  • 36
  • 59
Philippe Girolami
  • 1,876
  • 1
  • 13
  • 15
  • Please see this tutorial: http://stackoverflow.com/questions/5282936/android-backup-restore-how-to-backup-an-internal-database – Nam Vu Aug 04 '12 at 10:15
  • I'm getting exactly the same response, and the previous comment didn't appear to help on this? Did you solve this? How did you do it? – lblasa Nov 30 '12 at 13:26
  • 1
    Unfortunately not, I've had to just skip that functionnality for now. If you ever figure it out, do let me know ! – Philippe Girolami Dec 03 '12 at 16:16

2 Answers2

0

When you uninstall the app the backup data got removed. Lookup logs for

BackupManagerService: Removing backed-up knowledge of <app package>

Seems that backup/restore process can vary from manufacturer and device. Testing Backup and Restore document can simple work by uninstalling and installing using a nexus device, but I would not expect the same behavior and consistency on every device.

See also this answer https://stackoverflow.com/a/13648673/1598308

Community
  • 1
  • 1
Kamil Seweryn
  • 2,072
  • 2
  • 17
  • 23
0

Had the same error, only years later. It's probably because you are using Google Transport instead of LocalTransport. Google imposes a rate limit of 24 hours for every backup, so it's trying to create a backup, but it doesn't, and the restore fails.

  1. Run adb shell bmgr list transports to see the transports.
  2. Run adb shell bmgr transport android/com.android.internal.backup.LocalTransport to change the transport to Local.
live-love
  • 48,840
  • 22
  • 240
  • 204