Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Backing up databases in android cloud:

Can I use the Android Cloud to back up my application's databases? What are some limits to this feature?

like image 739
amiekuser Avatar asked Feb 08 '11 13:02

amiekuser


1 Answers

I came across the solution. Apparently it was there in the dev guide.Thought I should put it here so that others can be benefited from it.

The BackupAgentHelper class has SharedPreferencesBackupHelper to backup SharedPreferences files. FileBackupHelper to backup files from internal storage.

So in order to back up a database we need to extend BackupAgent to Back up data in a database. If you have an SQLite database that you want to restore when the user re-installs your application, you need to build a custom BackupAgent that reads the appropriate data during a backup operation, then create your table and insert the data during a restore operation.

Please visit this link for illustration: http://developer.android.com/guide/topics/data/backup.html#BackupAgent

like image 185
amiekuser Avatar answered Nov 17 '22 17:11

amiekuser