Auto Backup for Apps automatically backs up a user’s data from apps that target and run on Android 6.0 (API level 23) or higher. Android preserves app data by uploading it to the user’s Google Drive, where it’s protected by the user’s Google Account credentials. The backup is end-to-end encrypted on devices running Android 9 or higher using the device’s PIN, pattern, or password. The amount of data is limited to 25 MB per user. There’s no charge for storing backup data.
Files that are backed up
By default, Auto Backup includes files in most of the directories that are assigned to your app by the system:
- Shared preferences files
- Files saved to your app’s internal storage and accessed by
getFilesDir()
orgetDir(String, int)
- Files in the directory returned by
getDatabasePath(String)
, which also includes files created with theSQLiteOpenHelper
class - Files on external storage in the directory returned by
getExternalFilesDir(String)
Auto Backup excludes files in directories returned by getCacheDir()
, getCodeCacheDir()
, and getNoBackupFilesDir()
. The files saved in these locations are needed only temporarily and are intentionally excluded from backup operations.
References:
https://developer.android.com/guide/topics/data/autobackup