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???????
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){
}
}