ArrayList> arrayList = new ArrayList>();

Map listMap = new HashMap();


listMap.put(Config.MAP_Name, "正面");

listMap.put(Config.MAP_Value, base64FileString);

listMap.put(Config.MAP_GroupId, params[0]);

arrayList.add(listMap);


因为前端经常跟后台数据交互,也需要以Json 的格式上传数据,这时我们需要将数据转为Json的格式上传数据

有一个ArrayList 的数组。里面套一个Map的值如果想直接转为Json的歌是直接用


Gson gson = new Gson();

String jsonString = gson.toJson(arrayList);

就可以转为Json 的格式


更多相关文章

  1. android 使用post方式上传文件
  2. Android okHttp上传单张或多张照片
  3. Android中从服务器端向客户端传数据
  4. android 使用Java自带的HttpURLConnection 连接网络 读取返回数
  5. Android录音时,根据PCM数据获取音量值(单位分贝)
  6. android下大文件分割上传
  7. Android 之往通讯录中添加数据和查询数据

随机推荐

  1. Android(安卓)厘米转dip、px转dip 地图比
  2. android studio 2.3 NDK
  3. android中的三种xml解析方法---sax解析,pu
  4. Android(安卓)自定义view 和 onMeasure方
  5. Android(安卓)快速开发之快速实现“我”
  6. [android] toast解析
  7. Android(安卓)Activity间的过渡动画
  8. android 广播的知识积累
  9. Android执行打开文件(PDF,PPT,WORD,EXCEL
  10. Android客户端通过GET和POST向服务器发送