zoukankan      html  css  js  c++  java
  • json数据格式

        String find1 = Bmob.findByName("wtsr", where1.toString());//数据返回的结果
            //System.out.println("this:"+find1);
            JSONObject fromObject = JSONObject.fromObject(find1);//转化为json对象
            System.out.println(fromObject);

        输出结果{"results":[{"coorange":"0.37326197519106297,0.46580270797368295","createdAt":"2017-08-09 09:09:54","id":1,"name":"wth","number":"390099009","objectId":"B8XoAAAK","updatedAt":"2017-08-15 17:36:37"}]}
            JSONArray jsonArray = fromObject.getJSONArray("results");//获取json对象中的数组
            //System.out.println(jsonArray);
            for (int i = 0; i < jsonArray.size(); i++) {
                JSONObject jsonObject = (JSONObject) jsonArray.get(i);
                objectId =(String)jsonObject.get("objectId");
            }

    另一个复杂的json数据

    { "resultcode":"200",
      "reason":"查询成功!",
      "result":
        {"data":
            [
                {"MCC":"0","MNC":"0","LAC":"10342","CELL":"3873","LNG":"113.908476","LAT":"22.577146","O_LNG":"113.91334418403","O_LAT":"22.574103190104","PRECISION":"653","ADDRESS":"广东省深圳市宝安区新安三路"}
            ]
        },
     "error_code":0
    }

  • 相关阅读:
    ActiveReports打印的问题
    HTML高级应用
    一些常用的asp.net技巧焦点篇
    数据库操作
    [ASP.NET]在后台引用JavaScript
    点击TextBox复制其中内容
    VB.Net基本语句(推荐)
    ADO 对象
    控件不获得焦点
    32款网站优化工具
  • 原文地址:https://www.cnblogs.com/wth21-1314/p/7366473.html
Copyright © 2011-2022 走看看