google-cloud-java: Does this not work with Android?

I’ve had nothing but issue after issue, and still have not been able to get my app to run after adding the gradle dependencies listed in the docs:

compile group: 'com.google.cloud', name: 'google-cloud-storage', version: '0.9.3-beta'

Instead of copying over all the issues and error messages, i’ll link to the unanswered StackOverflow question i’ve already posted: http://stackoverflow.com/questions/42601917/accessing-cloud-storage-from-android

As mentioned, i’ve run into many issues and have still yet been able to run the app without errors. Before wasting even more of my time, I wanted to confirm if it’s even possible to use this client library with Android.

If it is not, how should I interact with my Cloud Storage buckets? All I’m trying to do is pull down some media stored in Cloud Storage.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 25 (6 by maintainers)

Most upvoted comments

This library is currently aimed primarily at server applications that need to make calls to GCP services. (In this scenario, the “server application” is the “client” of the “GCP servers”.)

Our currently-recommended way is to have your own server (e.g. on App Engine) that makes the calls to GCP, and your own Android app makes calls to your server. The reason is that google-cloud-java only has support for 2LO auth (service-account-based), not 3LO auth (user-account-based). If you make calls from your android app with 2LO auth, it’s theoretically possible for someone to steal your service credentials from your app and use them in their own app. This isn’t a problem with 3LO, though. With your App Engine app, you can use 3LO auth.

We have not done any specific work to make google-cloud-java compatible with Android, and there are a number of known issues (as you have discovered). First-class Android support will come at a later date.