tags:

views:

53

answers:

1

hi i have an image which is taken from andorid by calling image _capture how do i upload it to a windows server?

        Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
             startActivityForResult(intent, 0);


      public void onActivityResult(int requestCode, int resultCode, Intent data) {

 super.onActivityResult(requestCode, resultCode, data);


 if (resultCode == RESULT_CANCELED) {
 Toast toast = Toast.makeText(this,"camera cancelled", 10000);
 toast.show();
 return;
 }

// lets check if we are really dealing with a picture

 if (requestCode == 0 && resultCode == RESULT_OK)
 {

     Bundle extras = data.getExtras();
        Bitmap b = (Bitmap) extras.get("data");
        //setContentView(R.layout.main);

        ImageView mImg;
        mImg = (ImageView) findViewById(R.id.head);
        mImg.setImageBitmap(b);
   // save image to gallery
     String timestamp = Long.toString(System.currentTimeMillis());
     MediaStore.Images.Media.insertImage(getContentResolver(), b, timestamp, timestamp);

 }
A: 

Here's exactly what you need to do http://stackoverflow.com/questions/3038409/how-to-send-http-post-request-and-recieve-response/3038747#3038747

You may take a look at this article also http://www.theserverside.com/news/1365153/HttpClient-and-FileUpload. POST upload example should help.

Fedor