在Google settings 中,有个backup 选项,在里面选择开启

如果开启,还是在setting里面还是waiting for backup, 就通过手机链接电脑,安装android sdk。通过adb backup

1 adb shell bmgr backupnow --all

通过android 开发文档查看:backup的文件包含:

By default, Auto Backup includes files in most of the directories that are assigned to your app by the system:

  • Shared preferences files.
  • Files saved to your app's internal storage, accessed by getFilesDir() or getDir(String, int).
  • Files in the directory returned by getDatabasePath(String), which also includes files created with the SQLiteOpenHelper class.
  • Files on external storage in the directory returned by getExternalFilesDir(String).

Auto Backup excludes files in directories returned by getCacheDir()getCodeCacheDir(), or getNoBackupFilesDir(). The files saved in these locations are only needed temporarily, or are intentionally excluded from backup operations.

You can configure your app to include and exclude particular files. For more information, see the Include and exclude files section.

Note: https://developer.android.com/guide/topics/data/autobackup

在android manifest中:

Apps that target Android 6.0 (API level 23) or higher automatically participate in Auto Backup. In your app manifest file, set the boolean value android:allowBackup to enable or disable backup. The default value is true

1 <manifest ... >2     ...3     <application android:allowBackup="true" ... >4         ...5     application>6 manifest>

为防止其他第三方库的默认设置,最好加上tools:replace在application节点上:

1 tools:replace="android:theme,android:allowBackup"

 

转载于:https://www.cnblogs.com/CharlesGrant/p/11540180.html

更多相关文章

  1. android Manifest.xml选项-android:ConfigChanges
  2. android实践项目一实现简单的验证码和spinner下拉选项效果
  3. AndroidManifest.xml配置文件选项详解
  4. Android TimeLine 时间节点轴的实现
  5. Android Setting中添加解除屏幕锁选项
  6. 2010.11.11———Android TabHost选项卡组件
  7. Android 编译命令及选项(转)

随机推荐

  1. 在.NET Core类库中使用EF Core迁移数据库
  2. C#对Word文档的创建、插入表格、设置样式
  3. Asp.NET控制文件上传的大小方法(超简单)_
  4. c++如何获取数值极值的办法
  5. ADO调用分页查询存储过程的实例讲解_实用
  6. 关于c++中的引用总结
  7. asp.net部署到IIS常见问题的解决方法_实
  8. 实例详解sort()函数的原理和使用方法
  9. 基于MVC5中的Model层开发数据注解_实用技
  10. 代码详解AVL树的插入