Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should full backup content xml file be empty or not added at all to include all?

So I was adding some stuff to my application manifest and I saw that I had a warning on my application tag:

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.

And then I searched up for that. Apparently there are only 2 tags for that: <include> and <exclude>. I don't want to exclude any files from the backup as I don't have any local-depending files, and I don't need any <include> tags as

<include>: Specifies a set of resources to back up, instead of having the system back up all data in your app by default.

When I saw that if I don't put any <include> tags, then the system will back up all data in your app by default, which is exactly what I want.

Now I have this question: should I add the backup_content.xml file, but empty as the default settings are good, or not add the file at all? (in which case Android Studio will complain)

like image 261
Chaoz Avatar asked Mar 10 '16 18:03

Chaoz


People also ask

What is android fullBackupContent?

For this we have android:fullBackupContent in the application tag, which points to a XML file that contains full backup rules for Auto Backup. These rules determine what files get backed up.

What is contain manifest XML?

xml file in android. The AndroidManifest. xml file contains information of your package, including components of the application such as activities, services, broadcast receivers, content providers etc.

What is allow backup in manifest?

The allowBackup attribute determines if an application's data can be backed up and restored, as documented here. By default, this flag is set to true . When this flag is set to true , application data can be backed up and restored by the user using adb backup and adb restore .


2 Answers

Fast Solution:

AndroidManifest.xml

<application     android:allowBackup="true"     android:fullBackupContent="true"     ...     ...     ... </application> 

For more details see: https://developer.android.com/guide/topics/data/autobackup

like image 62
user_MGU Avatar answered Sep 21 '22 22:09

user_MGU


If you want to silence the warnings, but don't need to exclude any files from the backup, you could also just add tools:ignore="AllowBackup" to the application tag in your AndroidManifest.xml to suppress the warning (or use the Suppress button that you get when viewing the warning details).

like image 36
Hemaolle Avatar answered Sep 21 '22 22:09

Hemaolle