Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/222.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从android向rest web服务发送图像数组(使用java),反之亦然_Android_Arrays_Image_Rest - Fatal编程技术网

从android向rest web服务发送图像数组(使用java),反之亦然

从android向rest web服务发送图像数组(使用java),反之亦然,android,arrays,image,rest,Android,Arrays,Image,Rest,我想从android向rest web服务发送一组图像,反之亦然 因此,我需要在rest web服务中编写两个方法: 用于从客户端访问图像阵列 用于从rest web服务向android发送图像数组 我一直在互联网上寻找解决方案,但无法得到它 此问题的解决方案是什么?用于将字节数组转换为位图: byte[] iconData; Bitmap image = BitmapFactory.decodeByteArray(iconData, 0, iconData.length

我想从android向rest web服务发送一组图像,反之亦然

因此,我需要在rest web服务中编写两个方法:

  • 用于从客户端访问图像阵列
  • 用于从rest web服务向android发送图像数组
  • 我一直在互联网上寻找解决方案,但无法得到它


    此问题的解决方案是什么?

    用于将字节数组转换为位图:

    byte[] iconData;
    Bitmap image = BitmapFactory.decodeByteArray(iconData, 0,
                iconData.length);
    

    对于位图到字节数组,请使用:。

    用于将字节数组转换为位图:

    byte[] iconData;
    Bitmap image = BitmapFactory.decodeByteArray(iconData, 0,
                iconData.length);
    

    对于位图到字节数组,使用:。

    我的问题是发送位图数组而不是单个位图我的问题是发送位图数组而不是单个位图