AutoBackupForApps
This sample demonstrates how to selectively disable Automatic Backups in Android M, either by adjusting the location where data files are stored using getNoBackupFilesDir(), or by using a custom XML configuration file. This sample can also be used as a utility to test the behavior of the Automatic Backup feature. Executing "adb shell bmgr restore com.example.android.autobackup" from a terminal will cause the sample\'s data to be cleared and replaced with a copy from the backup server.
此示例演示了如何在Android M上有选择性地禁用自动备份,可以通过使用getNoBackupFilesDir()方法设置数据的存储位置,也可以通过使用自定义XML配置文件位置。该示例还可以用来作为一个实用程序来测试自动备份功能的行为。从终端执行“adb shell bmgr restore com.example.android.autobackup”会导致示例的数据被清除,并被备份服务器上的副本替换。
代码下载:
http://pan.baidu.com/s/1hq2PuPu