Note that there are some explanatory texts on larger screens.

plurals
  1. POUpload images from android to web service
    primarykey
    data
    text
    <p>i am trying to build an android app that takes an image from the camera. Then i send that image to a web service that i build and edit it. At this moment i am just trying to send the image and just get it back and show it in an imageView. I am just trying to see how is going to work with the web service. I am sending byte[] and receive byte[].Do i have to make a convert to the web service and return a different type or it ok to return byte[]? i use ksoap2 to connect with the web service. i don't know what to do when i get the result and how to convert the result to bitmap! Any Help???????</p> <p>Code: </p> <blockquote> <p></p> </blockquote> <pre><code> if (requestCode == CAMERA_DATA) if (resultCode == Activity.RESULT_OK) { Bundle extras = data.getExtras(); bitmap = (Bitmap) extras.get("data"); setContentView(R.layout.photo3); image = (ImageView) findViewById (R.id.imageView); ByteArrayOutputStream out = new ByteArrayOutputStream(); bitmap.compress(CompressFormat.JPEG, 100, out); data1 = out.toByteArray(); SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); request.addProperty("name",data1); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = false; envelope.setOutputSoapObject(request); HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); try { androidHttpTransport.call(SOAP_ACTION, envelope); SoapPrimitive resultsRequestSOAP = (SoapPrimitive) envelope.getResponse(); //WHAT TO DO HERE image.setImageBitmap(btm); } catch (Exception e) { } try { out.close(); } catch(IOException e){ } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload