From 337b0873f43eac5f23483bec94bd8729f79d47ec Mon Sep 17 00:00:00 2001
From: Scott Main Tip: While developing your application, you can initiate an
immediate backup operation from the Backup Manager with the bmgr tool.Key classes
@@ -43,6 +43,11 @@ page.title=Data Backup
See also
+
+
@@ -308,7 +313,7 @@ backup for all applications that have requested a backup since the last backup w
When the Backup Manager calls your {@link android.app.backup.BackupAgent#onBackup(ParcelFileDescriptor,BackupDataOutput,ParcelFileDescriptor) @@ -452,7 +457,7 @@ android.app.backup.BackupManager#requestRestore(RestoreObserver) requestRestore( href="#RequestingRestore">Requesting restore for more information).
Note: While developing your application, you can also request a -restore operation with the bmgr +restore operation with the {@code bmgr} tool.
When the Backup Manager calls your {@link @@ -813,7 +818,7 @@ onBackup()}.
Note: While developing your application, you can request a backup and initiate an immediate backup operation with the bmgr +href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr} tool.
@@ -828,25 +833,52 @@ android.app.backup.BackupAgent#onRestore(BackupDataInput,int,ParcelFileDescripto implementation, passing the data from the current set of backup data.Note: While developing your application, you can request a -restore operation with the bmgr +restore operation with the {@code bmgr} tool.
-To develop and test your backup agent:
-Once you've implemented your backup agent, you can test the backup and restore functionality +with the following procedure, using {@code bmgr}.
+ +adb shell bmgr enable true+
If you've properly implemented backup in your application, then it should request a +backup each time the data changes. For example, each time the user changes some data, your app +should call {@link android.app.backup.BackupManager#dataChanged()}, which adds a backup request to +the Backup Manager queue. For testing purposes, you can also make a request with the following +{@code bmgr} command:
+adb shell bmgr backup your.package.name+
adb shell bmgr run+
This forces the Backup Manager to perform all backup requests that are in its +queue.
+adb uninstall your.package.name+
If your backup agent is successful, all the data you initialized in step 4 is restored.
+ -- cgit v1.1