android - 为什么安卓:fullBackupOnly default value is false?

标签 android android-backup-service

https://developer.android.com/guide/topics/manifest/application-element ,

android:fullBackupOnly

This attribute indicates whether or not to use Auto Backup on devices where it is available. If set to true, then your app performs Auto Backup when installed on a device running Android 6.0 (API level 23) or higher. On older devices, your app ignores this attribute and performs Key/Value Backups. The default value is "false".

如果默认值为false,是否意味着所有Android 版本都会优先使用legacy Android Backup Service超现代Android Auto Backup

但是,根据https://developer.android.com/guide/topics/data/autobackup

Auto Backup for Apps automatically backs up a user's data from apps that target and run on Android 6.0 (API level 23) or later.

现代 Android Auto Backup 似乎是默认选择。如果是这样,为什么 android:fullBackupOnly 的默认值是 false

最佳答案

文档中使用的语言确实令人困惑。备份数据有两种方式:自动备份和Key-value备份。当您在 list 中定义 BackupAgentHelper 时,您正在使用键值备份。

  • android:fullBackupOnly=true 意味着您将始终执行自动备份,即使您在 list 中定义了 BackupAgentHelper。
  • android:fullBackupOnly=false 表示如果没有定义 BackupAgentHelper 则执行自动备份,定义 BackupAgentHelper 时执行 Key-value。

关于android - 为什么安卓:fullBackupOnly default value is false?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57357731/

相关文章:

java - Android Jsonarray无法转换为json对象

java - 备份/恢复共享首选项android

android - 什么是 "android:allowBackup"?

Android SharedPreferences 备份不工作

android - 无法解析 : com. google.android.material :material:1. 0.0-alpha1

android - 为什么不同设备的传感器值如此不同?

android - 测试实验室的仪器测试失败,错误的货币符号

java - 如何使代码在 21 :00 even though no user opens the application 运行

java - 检查 AlarmManager 任务是否正在进行

android - 工作意向服务 : Unable to schedule jobs with other apps - Oreo