Backing up databases in the android cloud:

Can I use Android Cloud to back up application databases? What are some limitations to this feature?

+4
source share
1 answer

I have found a solution. Apparently this was in the developer guide. Thought I should put it here so that others could benefit from it.

The BackupAgentHelper class has a SharedPreferencesBackupHelper for backing up SharedPreferences files. FileBackupHelper for backing up files from internal storage.

So, to back up the database, we need to expand BackupAgent to back up the data in the database. If you have the SQLite database that you want to restore when the user reinstalls your application, you need to create your own BackupAgent, which reads the corresponding data during the backup operation, and then creates your table and inserts the data during the restore operation.

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

+7
source

Source: https://habr.com/ru/post/1338847/


All Articles