Android Question managing user files in the cloud - FirebaseStorage vs. Google Drive/Oauth2?

Dave O

Active Member
Licensed User
Hi all,

I have a question about using FirebaseStorage vs. Google Drive/OAuth2 for uploading/downloading files in my apps.

I'm looking for a good (and easy) way for my apps to upload/download user data files for:
- backup/restore (if their data gets corrupted somehow, they can restore from a backup)
- import/export (a cloud folder that they (and the app) can access for importing/exporting CSV files)

So far, it looks like I could use Google Drive (via OAuth2) or FirebaseStorage because they both deal with files in the cloud. (I'm not interested in Dropbox or other solutions that need additional accounts set up.)

If I use Google Drive/OAuth2, it seems that:
- the user needs to grant permission to access their Google Drive account
- I have access to those files in their account (so the app can do its thing)
- They have access to those files (a handy place to import from/export to, instead of dealing with the Android file system)

If I use FirebaseStorage, it seems that:
- the user won't need to grant permission (because the files are stored in my Firebase account, under their userID?)
- I have access to those files in their userID folder (so the app can do its thing).
- They only have access to those files via the app, so there's no obvious way to use this setup for import/export.

Is this correct so far? Have I missed anything important?

Thanks!
 
Last edited:

Erel

Administrator
Staff member
Licensed User
Yes, however there is another option which might be better. Just let the user share the file. Example: https://www.b4x.com/android/forum/threads/97865/#content
The user will be able to use Google Drive, Dropbox or any other app.

You can then use ContentChooser to let the user choose the file. This way the user can use whichever service they like and your implementation will be very simple.
 

Dave O

Active Member
Licensed User
I thought of ContentChooser for the import/export case (and perhaps for the restore case), but for the backup case, I'm intending to do an automatic (silent) backup of their files periodically.

Does ContentChooser require a user interaction each time, or is there a silent way to use it?
 
Top