title: Send Images/Videos from Android/iOS to Google Cloud Endpoints
body: <p>I'm really needing your help/suggestion/clue/etc. I'm developing an application for Android and iOS which will allow the user to upload pictures and videos.</p>
  
  <p>What I'm trying to do:</p>
  
  <p><strong>1 - Android/iOS send picture/video to my Google Cloud Endpoint;</strong></p>
  
  <p>2 - Google Cloud Endpoint upload the image/video to Google Cloud Storage; (Works)</p>
  
  <p>3 - Google Cloud Endpoint retrieve the servingURL from Google Cloud Storage and send back to Android/iOS; (Works)</p>
  
  <p>4 - Android/iOS stream the picture/video by its URL. (Works)</p>
  
  <p>So the problem is just the first step, send the image/video to Google Cloud Endpoint.</p>
  
  <p>I'm reading a lot, searching, researching and didn't figured out how to do it.</p>
  
  <p>Please, ANY suggestion will be appreciate. I'm open to new ideas about the way to implement this feature as well. Thank you guys!</p>
  
  <p>.</p>
  
  <p><strong>- - - - - - - - - - - - - - - - - - - - -- - - - - - - - UPDATE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -</strong></p>
  
  <p>.</p>
  
  <p>After research a bit more I noticed the better way to do it would be uploading straight from Android/iOS. I figured out how to do it but now I got stuck about how to implement the servlet to get called automatically after the client upload the file using the urlUpload generated by my endpoint. </p>
  
  <p>So far I did:</p>
  
  <p>1 - Client request my Google Endpoint to retrieve URL for upload;</p>
  
  <p>2 - Google Endpoint generates '/upload' url using with this code:</p>
  
  <pre><code>BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
  UploadOptions uploadOptions = UploadOptions.Builder.withGoogleStorageBucketName(ConstUtil.storage.BUCKET_NAME);
  
  String uploadUrl = blobstoreService.createUploadUrl("/upload", uploadOptions);
  
  response.setSimpleString(uploadUrl);
  response.setCode(MWCode.SUCCESS.getCode());
  response.setMessage(MWCode.SUCCESS.getMessage());
  
  return response;
  </code></pre>
  
  <p>3 - Client (Android/iOS) receive this url and upload the file (I didn't implement it yet but I saw many clean example and looks very easy to understand)</p>
  
  <p><strong>4 - Blobstore service fire Google Endpoint as callback sending keys of the uploaded object</strong></p>
  
  <p>5 -  I use Blob keys to retrieve servingURL to serve the files with clients (Android/iOS) (already implemented)</p>
  
  <p>I have no idea about how to implement the step 4 once all tutorials and examples I see are not using Google Cloud Endpoints. Please, does anyone can give me the path/link/code or clue of how I could implement it?</p>