My app is setup to allow backups to be saved to a Google Drive appdata folder. It all works perfectly well on the same device. When I make a backup, delete the app's data, then restore it all works.
However, when I try to backup on one device, then install on another and attempt to restore there are no files found. Same goes for when I uninstall the app on the original device, reinstall it on the same device and attempt to restore. Both cases result in no files being found despite the fact that I see there are files in the appdata folder when I log into Google Drive.
I read somewhere that you must use the RESOURCE_ID instead of the DRIVE_ID of a file for it to work between devices since a DRIVE_ID will be different from device to device. However the only way I've seen how to get the RESOURCE_ID is by using the driveId.getResourceId(), and I can't get the proper DRIVE_ID from another device.
tl;dr: how should I go about retrieving the proper file from the appdata folder that was created by another device/installation?
Via the site you open the settings menu and then choose "Manage Apps". Via the Drive app you can select Backups in the left menu, select a device, then App data and you'll get to see the list of apps and info.
Create a folder On your Android phone or tablet, open the Google Drive app. Tap Folder. Name the folder. Tap Create.
It's in hidden partition “/data"which you cannot access without root permissions. /data/data/com. google.
I have a database backup option in my app as well. I implemented it using the new Google Drive Android Api and what's more important, it works perfectly fine from one device to another.
Here's how I did it and what I recommend:
I hope these points can help with your implementation. If you need anything else, just tell.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With