Data Backup :
Data Backup Android Backup Service
copy persistent application data to a remote "cloud" storage
restores your backup data when the application is re-installed.
Backup Manager
requests backup data from the application, then delivers it to the cloud storage
retrieves the backup data from the backup transport and returns it to the application
Backup Agent :
Backup Agent declare the backup agent under the manifest
android:backupAgent
Extend BackupAgent
onBackup()
onRestore()
Extend BackupAgentHelper
Backup :
Backup perform under onBackup() within BackupAgent
Backup Manager pass three parameters to onBackup()
oldstate
data
newstate
Restore :
Restore perform under onRestore() within BackupAgent
Backup Manager pass three parameters to onRestore()
data
appVersionCode
newstate
BackUpAgentHelper :
BackUpAgentHelper SharedPreferencesBackupHelper
backup SharedPreferences files
FileBackupHelper
backup files from internal
Checking Restore App Version :
Checking Restore App Version Application Version is saved during Backup
Backup Manager evaluate the version for Restore
android:restoreAnyVersion
Manual trigger Backup Manager :
Manual trigger Backup Manager dataChanged()
requestRestore()
bmgr
adb shell bmgr backup <package>
adb shell bmgr run
adb shell bmgr restore <package>
Q & A :
Q & A