I\'ve googled a lot but it doesn\'t work. I found a lot of sites with information but by all the sites my app crashed. The picture that I want to open is: \"lastfile.png\".
The way I did it was to compress the img in to a type of string then send it as name value pair then decode the string on server end using php.
Bitmap bitmapOrg = BitmapFactory.decodeResource("your image path on device");
ByteArrayOutputStream bao = new ByteArrayOutputStream();
bitmapOrg.compress(Bitmap.CompressFormat.JPEG, 90, bao);
byte [] ba = bao.toByteArray();
String ba1= Base64.encodeToString(ba, 0);
ArrayList nameValuePairs = new
ArrayList();
nameValuePairs.add(new BasicNameValuePair("image",ba1));
try{
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://your_url/sink.php");
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
is = entity.getContent();
}catch(Exception e){
Log.e("log_tag", "Error in http connection "+e.toString());
}
SINK.PHP
';
?>