0
votes

I am using google cloud storage for storing profile images for one of the android app which we are developing. I am able to store images to the cloud properly..I want to set the same image to imageview in my application using picasso API. It is saying Access denied, When I share Image on cloud publicly, it is setting image to Imageview, otherwise not...

How could I give these public share through android application for user to set images using Picasso?

Thank you in advance

1

1 Answers

0
votes

When you upload the image you must make sure (assuming you don't want authentication) the ACL is set to publicRead.

The upload in java looks like this:

storage.objects()
        .insert(BUCKET_NAME, null, content)
        .setName(fileName)
        .setPredefinedAcl("publicRead")
        .setKey(API_KEY)
        .execute();

For setting the ACL manually in the developers console tick the "shared publicly" check box.

The url then looks like this: http://storage.googleapis.com//

Good luck.