开发者

Backing up databases in android cloud:

Can I use the Android Cloud to back up my application's databases? Wh开发者_JAVA百科at are some limits to this feature?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜