Android Question backing up users' app data?

Dave O

Well-Known Member
Licensed User
Hi all,

Short version: How can I let users back up their data from my apps, in case they switch phones or get their data messed up (by them or by a bug in the app)?

Longer version:
My apps typically store data in files in DirInternal (as you would expect for simple apps).

Several users have asked how they can make backups of this data in case something bad happens (see above.)

I know that Android already backs up app data using the user's Google account (assuming that's turned on), so that's one solution. But because it's invisible (or not turned on), users want an explicit way to back up/restore their data in my apps.

One of my apps has an Import/Export feature, which reads/writes CSV files using GetSafeDirDefaultExternal. That's a bit awkward for non-technical users to deal with, though, because they need to connect their phone to a computer and navigate the Android file system to find the right folder.

I'm thinking of adding an auto-backup feature using something like FirebaseStorage. The key thing is that it should be easy for them to do a backup (probably automatically) and a restore (as needed).

Has anyone come up with a good solution to this? Thanks!
 

JohnC

Expert
Licensed User
Some ideas:

1) You could create a zip file that contains the user's data and then email the zip file to a destination the user specifies. This way, they don't have to "find" any folders to do the "export". However, they would need to later "save" the zip attachment onto their new device and then do an "import" and they would need to select the folder they saved the zip file in.

2) Another idea is to save the zip file into the user's Google Drive - maybe into a new folder that your app creates. This way the user can simply do an "import" and your app will look in that special folder for the zip file and import it with minimal user intervention.
 
Upvote 0

Dave O

Well-Known Member
Licensed User
@JohnC you're right, the "export" part is easy, but the import is harder because of the file system.

I like your idea of using the user's Google Drive, because I'm pretty sure I can connect to that using B4A code or libraries (getting the user's permission of course), and it keeps their data in their account, not an account that I have access to (better privacy). And that's conceptually similar to FirebaseStorage (another third-party file repository), so that gives me some options to try.

Thanks!
 
Upvote 0
Top