Backup app data with BackupManager

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Backup app data with BackupManager

Igor Velikorossov

Google provides data backup service (, which I'm trying to take advantage of.

I followed the instructions, but I can't seem to get it working. I've done the following:

  1. Registered for the backup service and got the key
  2. Updated the manifest.xml

    <application android:backupAgent="app.namespace.MyBackupAgentHelper"
        <!-- backup service registration -->
        <meta-data android:name="" 
                   android:value="xxxxxxxxxxxxxxxxxxxxxx" />
  3. Extended BackupAgentHelper

    namespace App.Namespace
        public class MyBackupAgentHelper : BackupAgentHelper
            public override void OnCreate()
                var fbh = new FileBackupHelper(this, this.GetDatabasePath(Const.Database.Name).AbsolutePath);
                this.AddHelper("DATABASE", fbh);
  4. In my database helper I initialise BackupManager and upon data change call this.backupManager.DataChanged();

And it doesn't seem to work as expected - when I uninstall and reinstall the app the database I expect to be backup isn't getting restored.

I have also tried instigating backup manually (as per instructions to no avail.

Any help is appreciated. Thanks

Monodroid mailing list
[hidden email]