Android application backup

警告

AndroidMenifest中application标签下android:allowBackup="true"时,会警告:

Warning:On SDK version 23 and up, your app data will be automatically backed up and restored on app install. Consider adding the attribute android:fullBackupContent to specify an @xml resource which configures which files to backup. More info: https://developer.android.com/training/backup/autosyncapi.html
警告:在SDKVersion 23和更高版本上,应用程序数据将在应用程序安装上自动备份和恢复。考虑添属性‘android:fullBackupContent’以指定一`@xml‘资源,该资源配置哪些文件要备份。更多信息:https://developer.android.com/training/backup/autosyncapi.html

alt+enter可以添加属性android:fullBackupContent="@xml/backup_descriptor"
并自动在xml包下创建backup_descriptor.xml
在这个xml文件中,可以定义需要备份(include)和不需要备份(exclude)的相关数据,并指定数据保存方式

<full-backup-content>
    <include domain=["file" | "database" | "sharedpref" | "external" | "root"] path="string" />
    <exclude domain=["file" | "database" | "sharedpref" | "external" | "root"] path="string" />
    <exclude domain="database" path="device_info.db"/>
</full-backup-content>
posted @   brave-sailor  阅读(548)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
历史上的今天:
2018-04-02 android BLE Peripheral 手机模拟设备发出BLE广播 BluetoothLeAdvertiser
2015-04-02 Android中dp,px,sp概念梳理以及如何做到屏幕适配
点击右上角即可分享
微信分享提示