allowBackup
determines whether or not application data can be saved / restored by the backup and restore infrastructure.
If the app runs on an Android device 6 or higher, nothing needs to be done by the developer, backup / restore runs automatically.
The backup occurs when the following circumstances occur:
- Device is inactive.
- The device is loading.
- The device is connected to the WI-FI network
- At least 24 hours have passed since the last backup
restore occurs when you reinstall the application.
All data except the following are stored by default:
- Files in folders returned by methods
getCacheDir()
and getCodeCacheDir()
.
- Files in "external storage", except those in the folder returned by the
getExternalFilesDir()
method.
- Files in the folder returned by the
getNoBackupFilesDir()
In versions prior to Android 6 the backup / restore can be done manually via adb using the bmgr , or by BackupApi , extending the < in> BackupAgentHelper .
More information in the documentation: