I’m working on a project where I need to sync a small XML configuration file between my Android app and a Java desktop application. The workflow is pretty simple - user clicks a button in the Android app to upload the XML file to cloud storage, then later they open the desktop app which downloads that same file.
I thought Google Drive would be perfect for this, but I’m running into some confusing documentation. There’s this warning that says apps need to be installed from Chrome Web Store before they can access user files, even with proper authorization.
Is there a straightforward way to read and write files directly to Google Drive if I have the user’s credentials? I’m looking for the simplest approach that won’t create headaches for my users. Any alternative cloud storage solutions that might work better for this desktop app scenario?
dropbox API beats google drive for desktop apps - no oauth mess, just app tokens. but google drive’s oauth isn’t terrible once you figure it out. just handle refresh tokens right or your users will constantly get logged out.
The Chrome Web Store requirement only applies to web apps, so your Java desktop app doesn’t need it. You can use the Google Drive API directly with OAuth 2.0 - no web store approval needed. Just create your OAuth credentials as a desktop application in Google Cloud Console. Your app will walk users through authentication by opening their browser for login, then return the authorization code so you can get the access token for file operations. For simpler XML file sync between Android and desktop, I’d actually recommend Firebase Storage or Dropbox API instead. They’re much easier to authenticate with, especially since Firebase integrates so well with Android apps.
Been there, done that. I ditched Google Drive for OneDrive API and haven’t looked back. The auth flow is way cleaner for desktop apps - just register in Azure AD and you’re good to go. No web store headaches. Microsoft’s docs actually make sense, unlike Google’s confusing mess. The REST calls are dead simple for basic stuff like uploading/downloading XML configs. OneDrive handles file versioning automatically, which saved me tons of work. Plus the auth tokens last longer, so users aren’t constantly getting nagged to re-authenticate. Definitely worth it if you want something that actually works without the hassle.