"Back up user data with Auto Backup" not working
One of my apps I'm wanting the sharedprefs to be backed up.
I have followed this: https://developer.android.com/guide/topics/data/autobackup.html#EnablingAutoBackup
And have enabled the sharedprefs to be backed up (even though it says they will be by default anyway) through the xml file as suggested.
I can see in the backup on the phone that it says my app keeps getting backed up when I make any changes in it. However, if I uninstall and re-install the app, everything is reset.
Can anyone offer any insight into this?
I'm currently planning a project that uses SQLite, but it's not worth it if auto backup doesn't work as I find it annoying when I wipe my phone or get a new one and there's nothing saved by an app and I don't want to piss users off.
Thanks
Posted Sep 13, 2019, 5:29 AM UTC
Backups are not instant and scheduled by the system whenever it wants to. You can sort of force it with adb for testing, but this is not the easiest thing to test. Also, backup has to be enabled for apps in Android settings as well as restore.
thanks, is there a better way to backup that would not cost anything to the dev (it's only a small, free app)
I think I understand it more now.
My app is backing up, but it won't restore the data unless it's done through a restore, like a new phone (rather than uninstalling and re-installing the app). But using ADB you can force it to restore like it would in that situation.
Maybe I'll look into a cheap server with MySQL and do it that way, unless someone knows a cheaper/easier way to keep data backed up?