为什么android:fullBackupOnly默认值为false? [英] Why android:fullBackupOnly default value is false?

查看:565
本文介绍了为什么android:fullBackupOnly默认值为false?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

https://developer.android.com/guide/topics/清单/应用程序元素


android:fullBackupOnly

android:fullBackupOnly

此属性指示是否在可用的设备上使用
自动备份。如果设置为true,则
在安装到运行
Android 6.0(API级别23)或更高版本的设备上时,您的应用会执行自动备份。在较旧的设备上,您的应用程序
会忽略此属性,并执行键/值备份。
的默认值为 false。

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版本都将优先使用旧版 Android备份服务 在现代的> Android自动备份

If the default value is false, does that mean all Android version will prefer legacy Android Backup Service over modern Android Auto Backup?

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


自动备份应用会自动从以
为目标并在Android 6.0(API级别23)或更高版本上运行的应用中备份用户数据。

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自动备份。如果是这样,为什么 android:fullBackupOnly 的默认值是 false

Seem like modern Android Auto Backup is the default choice. If so, why the default value for android:fullBackupOnly is false?

推荐答案

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

The language that is used in documentation is confusing indeed. There are two ways to backup data: Auto-backup and Key-value backup. When you define a BackupAgentHelper in you manifest, you are using Key-value backup.


  • android:fullBackupOnly = true 表示您将始终执行自动备份,即使您在清单中定义了BackupAgentHelper,也是如此。

  • android:fullBackupOnly = false 表示如果未定义BackupAgentHelper,则执行自动备份;如果定义了BackupAgentHelper,则执行键值定义。

  • android:fullBackupOnly=true means that you will always do Auto-backup, even if you have a BackupAgentHelper defined in your manifest.
  • android:fullBackupOnly=false means that you do Auto-backup if no BackupAgentHelper is defined, and Key-value when a BackupAgentHelper is defined.

这篇关于为什么android:fullBackupOnly默认值为false?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆