I'm looking to implement the new autobackup feature introduced in Android M, as detailed in the docs here: http://developer.android.com/training/backup/autosyncapi.html#testing
I'm after easily restoring player database and shared preferences between installs, which this feature purports to enable for Android M. I'm not implementing the android backup service at this time.
The docs claim it's basically enabled by default, no need to write backup management classes and the like, at least for Android M devices - however, I can't get it to work.
abd shell bmgr enabled
returns Backup Manager currently enabled
adb shell bmgr run
doesn't say anything, but when I then run adb shell bmgr restore com.xyz.abc
I get told:
Unable to restore package com.xyz.abc
done
The docs say adb shell setprop log.tag.BackupXmlParserLogging VERBOSE
will enable logging, but I can see literally no effect in the terminal or in logcat, and I can't think of another place that it would log to!
My manifest has android:fullBackupContent="@xml/backupscheme"
in the application tag, as per the docs, and backupscheme.xml contains
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<include domain="database" path="database.db"/>
<include domain="sharedpref" path="com.xyz.abc_preferences.xml"/>
<exclude domain="external"/>
</full-backup-content>
The database and shareed preferences paths came from checking the decompiled app, and I've tried with this xml stripped back to nothing - nothing changes.
As far as I can tell from the docs, that should be sufficient for it to work, and yet I'm seeing nothing being persisted when I uninstall and reinstall the app.
Am I overlooking something? Are there any assumptions I'm making that I haven't questioned? Why doesn't it just work?! There's so little information out there, I really hope someone else is implementing this and has some guidance here!