如何在Android中使用网络服务将图像(作为字节数组)上传到服务器?
答案 0 :(得分:0)
对于soap webservices,您可以使用ksoap2。还有一个wsdl> proxy.java生成器
答案 1 :(得分:0)
**To upload your Image to server, convert a bitmap image to base64 and then send the string. Use the below code**
Bitmap resizedBitmap = Bitmap.createBitmap(bmp, 0, 0, width,
height, matrix, true);
ByteArrayOutputStream baostream = new ByteArrayOutputStream();
resizedBitmap.compress(Bitmap.CompressFormat.PNG, 100, baostream);
byte[] byteArrays = baostream.toByteArray();
encode = Base64.encodeBytes(byteArrays);
**and vice-versa**
byte[] decode = Base64.decode(encode);
Bitmap bitmp = BitmapFactory.decodeByteArray(decode, 0,
decode.length);