3

I have currently set up the client side of my Android application (working on it for a couple of months new to Android). The functionality on the client side is to allow the user to click a photo and attach some textual information to it. Once the user has clicked the photo followed by adding text information, he/she clicks on "Done".

This information needs to be sent to the Server. For my project it is a pre requisite to use Google App Engine. So the best possible way forward that I understood to store images is to use the Blobstore Service api. https://developers.google.com/appengine/docs/java/blobstore/overview

As I am new to using Google App Engine I have not much idea about the interaction between the Android device and the Blobstore service.

I now understand how to use the Blobstore service for a Web app (did the tutorial on Google App Engine http://www.rominirani.com/2009/12/18/episode-13-using-the-blobstore-java-api/) but I do not understand how different it is for an Android Application. I have not been able to find much documentation between the use of Blobstore Api Service with Android. So I wanted to know if it is a correct decision made by me on using the Blobstore service for uploading image from the Android Device. Is there any other suggestion/better way.

Any help would be really appreciated because my project is on stand still for the last few days. Thank You very much

user1974849
  • 35
  • 1
  • 5
  • 1
    it's just HTTP commands, that it's android is almost irrelevant. https://developers.google.com/appengine/docs/python/blobstore/overview#Uploading_a_Blob – Paul Collingwood Jan 20 '13 at 12:49

1 Answers1

6

Two steps:

  1. On server side create blob upload handler, which handles multipart/form-data HTTP POST requests.

  2. On Android create a multipart HTTP POST request.

Community
  • 1
  • 1
Peter Knego
  • 79,991
  • 11
  • 123
  • 154
  • Thank you very much for your response! It is really helpful in understanding the concept now. – user1974849 Jan 21 '13 at 10:55
  • Can you please clarify one last bit. Using Step 1 - how do you bypass the browser(JSP page) in the Android application. Because as I understand it says a browser page will have to be opened and if that is case having a browser page open in the Android Application on clicking of "Done" would just ruin the user experience in the application. Is there any way around it or is it something that can not be avoided? Thank you once again – user1974849 Jan 21 '13 at 11:05
  • No, JSP page creates a HTML form, which (on submit) makes a HTTP POST request with multipart/ford-data content. All you need to make is this request in your Android code - see second link. – Peter Knego Jan 21 '13 at 11:20
  • When you say JSP page will create a HTML form - user clicks done on this HTML form will he still be in the Android Application after uploading the photo or will he be out of the app (browser). Is a very trivial question but just wanted to get clear – user1974849 Jan 23 '13 at 12:04
  • Thank you for your help because I have understood the process and working on it but just wanted to clarify the above minor concern – user1974849 Jan 23 '13 at 12:53
  • There should be no JSP page used on Android, so no browser should be used. You should create the same request that JSP does, but in Android code. – Peter Knego Jan 23 '13 at 19:23
  • Peter - thank you very much your explanation has been really helpful. – user1974849 Jan 25 '13 at 18:03