I'm trying to figure out the best way to send a bitmap to a webserver to store into a database. Right now, I am sending a string placeName to the server like this:
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("mywebserver");
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("placeName",placeName));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
This is successful. Now, basically what I want to do is something like this
Bitmap photo = (Bitmap) data.getExtras().get("data");
nameValuePairs.add(new BasicNameValuePair("placePhoto",photo));
//obviously pseudocode
Is there a way I can do this? Thanks.