Sending byte array with ksoap2 on android

◇◆丶佛笑我妖孽 提交于 2019-12-04 21:36:42

Ah, got it in the end. My bindings and service declaration were all messed up in the web.config, and so my changes to maxReceivedMessageSize etc weren't having any effect because the service was using the default bindings instead of using my custom one.

you need compress the imagen

String imageEncoded;
InputStream is = activity.getContentResolver().openInputStream(uri);
Bitmap img = BitmapFactory.decodeStream(is);
ByteArrayOutputStream convert = new ByteArrayOutputStream();
img.compress(Bitmap.CompressFormat.JPEG, 50, convert);
byte[] b = convert.toByteArray();
imageEncoded = Base64.encodeToString(b, Base64.DEFAULT);

And then convert using Base64 no byte.. on android only convert to byte aprox 50mb no more

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!