Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upload and retrieve images from Google Cloud Storage on the Android app

I am building an android app where users need to upload & retrieve the images. I need to do that with the Google Cloud Storage. How can I do that if there is a way? I have used PHP as a backend & APIs. I see that they provide APIs for that but there is no way of direct implementation with the PHP. The backend and APIs' code is uploaded on the Google Compute Engine.

like image 623
gautamlakum Avatar asked Sep 08 '16 09:09

gautamlakum


People also ask

How do you get pictures from Google Cloud Storage?

If you want to download all the photos from the Google photos, sign-in to your Google account and click on the 'Album. ' Now, tap on the three dots on the upper right corner and click on the download option. You can also select the photos and makes a zip folder of the pictures as you chose to download them.


1 Answers

You could either upload the image on your frontend and give the url of the image to your BackEnd. Or you could use the GCS JSON API from your php backend to upload the image from there. Here is an example of using the JSON API to upload an image to cloud storage, but in the end it's just a simple POST request which can easily be done in php.

Further info: https://cloud.google.com/storage/docs/json_api/ https://cloud.google.com/storage/docs/json_api/v1/json-api-php-samples

like image 189
Serge Hendrickx Avatar answered Oct 14 '22 15:10

Serge Hendrickx