Posts

Showing posts from April, 2014

Upload an image from Android to Google's app engine server

Recently I have started working on a project on Android. This app involves uploading few images chosen by user to the server. App engine has a document page at https://developers.google.com/appengine/docs/java/blobstore/ , but unfortunately for Android developer it is not enough. This document mentions how to upload using web client i.e. using using form in a html page. For uploading using java application we need a multipart message. We need following libs: 1. httpcore-4.3.2.jar 2. httpmime-4.3.3.jar httpcore-4.3.2.jar and httpmime-4.3.3.jar can be found at http://hc.apache.org/downloads.cgi .These jars are part of zip file containing other files. Extract the entire zip and copy these two required files in <android project>/libs. public void uploadBlobImage( String path, String link ) { HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(link); try { MultipartEntity entity = new MultipartEntity(); ...