我的应用使用一个小型的SQLite数据库,我希望将其备份。我认为这不会自动发生,除非我编写fullBackupContent代码,如下所示。我该如何修改backupscheme.xml文件的内容以正确设置包含路径?我更喜欢在运行时设置数据库位置。
我的backupscheme.xml文件如下:
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content >
<include domain="database" path="device_info.db"/>
</full-backup-content
我的清单包含:
<application
android:allowBackup="true"
android:icon="@drawable/time_machine_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:name="mypackage.myapp"
android:fullBackupContent="@xml/backupscheme"
>
device_info.db
,那么看起来您已经准备好进行备份了。 - CommonsWare