Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Android Auto Backup for Apps?

There are only few questions @ so about Android Auto Backup. I have not used this before so went through the documentation first! https://developer.android.com/guide/topics/data/autobackup.html#Files

Then I made a sample app and managed to add to the list of apps that have been backed up in the Google Drive.

But still I would like to clear things from so because it makes easy to understand than a document.

Here are few points I messed up.

Restore schedule

The device can restore from either its own backups or the ancestral dataset. The device prioritize its own backup if backups from both sources are available. If the user didn't go through the device setup wizard, then the device can restore only from its own backups.

  • This can go upto 25MB.Let's say I uninstall an app an reinstall it again.Not at what stage it takes the backup? Do i need to follow any technique eg: like a splash till it completes onRestoreFinished()? if there is like 20 MB data? Any good example for this?

Enabling and disabling backup

<application ...
    android:allowBackup="true">
</app>

To disable Auto Backup, set android:allowBackup to false. You may want to disable backups when your app can recreate its state through some other mechanism or when your app deals with sensitive information that should not be backed up

  • This line is in the Manifest so what can be the best way to make it false once the backup task is done.Let's say registration is done and that's all i want to back up.How can I update that tag value at run time?

  • Is there any way to reset 25MB backup quota by deleting the existing backup?

Thanks

like image 388
Charuක Avatar asked Feb 05 '23 06:02

Charuක


1 Answers

Not at what stage it takes the backup? Do i need to follow any technique eg: like a splash till it completes onRestoreFinished()? if there is like 20 MB data? Any good example for this?

Lucky for us developers, this is done automatically, during the app installation, which can occur in a few situations:

Data is restored whenever the app is installed, either from the Play store, during device setup (when the system installs previously installed apps), or from running adb install. The restore operation occurs after the APK is installed, but before the app is available to be launched by the user.

From restore schedule


This line is in the Manifest so what can be the best way to make it false once the backup task is done.Let's say registration is done and that's all i want to back up.How can I update that tag value at run time?

That is not possible. As you can read in Backup schedule, it is automatically done on a somewhat regular interval. If you have requirements that conflict with this schedule, you have to implement your own backup mechanism.


Is there any way to reset 25MB backup quota by deleting the existing backup?

This is not necessary. Only one backup exists at a time. When a new backup is made, the old one is deleted:

Backup data is stored in a private folder in the user's Google Drive account, limited to 25MB per app. The saved data does not count towards the user's personal Google Drive quota. Only the most recent backup is stored. When a backup is made, the previous backup (if one exists) is deleted.

From backup location

like image 146
Tim Avatar answered Feb 15 '23 12:02

Tim