Androidアプリ:android:fullBackupContentの宣言
Android Studioで、以下のようなエラーメッセージが表示されました。
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, or just set android:fullBackupOnly=true.
SDK23(Android6.0)以降になると、自動的にアプリデータのバックアップをする機能が追加されており、対応するために、android:fullBackupContent属性を追加してほしい、という内容です。
バックアップされるデータは、アプリ内のユーザデータで、ユーザのGoogleドライブに25MBを上限に保存するというもののようです(このデータ容量はGoogleドライブの個人の使用量にはカウントされないそうです)。
バックアップをしない
AndroidManifest.xmlのapplicationにandroid:fullBackupContent=”@xml/backup_rules”を追加すると、さらにそのバックアップルールの定義ファイル(res/xml/backup_rules.xml)の設定などが必要になるため、ここではバックアップをしない設定にします。
バックアップをしない場合には、android:allowBackup=”false”にすればよく、警告も出なくなります。
<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:hardwareAccelerated="false"
android:largeHeap="true"
tools:ignore="LockedOrientationActivity"
>
関連記事