码迷,mamicode.com
首页 > 移动开发 > 详细

Android application backup

时间:2019-04-02 10:50:31      阅读:271      评论:0      收藏:0      [点我收藏+]

标签:androi   figure   保存   ice   idm   cap   des   version   path   

警告

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>

Android application backup

标签:androi   figure   保存   ice   idm   cap   des   version   path   

原文地址:https://www.cnblogs.com/Free-Thinker/p/10640937.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!