I've been trying to implement the backup on my app for more than a month, but no success till now. I had done every steps that Google docs inform: Registered on Google Service Changes on Manifest (allowBackup, backupAgent and backup.api_key (google service register) and so on...
Manifest parts:
<application
android:allowBackup="true"
android:backupAgent="my.package.MyBackupManagerClass">
<meta-data android:name="com.google.android.backup.api_key"
android:value="my-generated-key-by-google-service" />
In fact, the backup is working, but only using the Local transport, I had tested using bmgr backup/run/restore:
bmgr list transports
* android/com.android.internal.backup.LocalTransport
com.google.android.gms/.backup.BackupTransportService
But when trying to use the Google transport (cloud: com.google.android.gms/.backup.BackupTransportService
) it does not works, not even call my onCreate()
from MyBackupAgentHelper
.
One point that I want to mention is that when I run: bmgr backup bmgr run
After run command, on the logcat shows a lot of "Now staging backup of " (also shows my apps package on this list) but it happens very fast and don't seems that the backup is being done in fact, after all, even my MyBackupHelper.onCreate() is not called:
02-12 21:13:28.889: D/BackupManagerService(547): Now staging backup of com.google.android.talk
02-12 21:13:28.904: D/BackupManagerService(547): Now staging backup of com.google.android.dialer
02-12 21:13:28.907: D/BackupManagerService(547): Now staging backup of com.android.providers.settings
02-12 21:13:28.910: D/BackupManagerService(547): Now staging backup of com.sirma.mobile.bible.android
02-12 21:13:28.914: D/BackupManagerService(547): Now staging backup of com.android.sharedstoragebackup
02-12 21:13:28.919: D/BackupManagerService(547): Now staging backup of com.google.android.gm
02-12 21:13:28.922: D/BackupManagerService(547): Now staging backup of com.android.providers.userdictionary
02-12 21:13:28.926: D/BackupManagerService(547): Now staging backup of com.google.android.apps.genie.geniewidget
02-12 21:13:28.963: I/GmsBackupTransport(1409): Next backup will happen in 86399923 millis.
02-12 21:13:28.967: I/BackupManagerService(547): Backup pass finished.
I had the same situation - when i run manual backup (through adb shell command) is working, but only using the Local transport. For me the solution was to publish Google Play services, because I've tested data backup service without published GP services. Check your proguard configuration also if you're using Proguard
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With