Data Backup http://developer.android.com/guide/topics/data/backup.html
xxx
Summary Allows you to copy your persistent
application data to remote "cloud" storage, once an user performs a factory reset or converts to a new
Android-powered device, the system automatically restores your backup data when the application
is re-installed.
Classes
BackupAgent
void onBackup(ParcelFileDescriptor oldState, BackupDataOutput data, ParcelFileDescriptor newState) - oldState It points to the last backup state, in which all meta-data is saved, such as timestamp, app version etc. May be null, in which case no prior state is being provided. - data It points to the backup data destination. You need to write all data to be backed into this object. - newState You should record the final backup
state here after writing the requested data to the data
output stream.
void onRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState) - data It points to a full snapshot of the
application's data. You need to read all data to be restored from this object. - appVersionCode
The value of the android:versionCode manifest attribute, from the application that backed up this particular data set.
- newState
You should record the final backup
state here after restoring its data from the data stream.
When a full-backup dataset is being restored, this will be null.