我正在解析 Json
这是我的java代码
if(jsonstr!=null){
try{
JSONObject jsonResponse = new JSONObject(jsonstr);
/***** Returns the value mapped by name if it exists and is a JSONArray. ***/
/******* Returns null otherwise. *******/
JSONArray jsonproduct = jsonResponse.optJSONArray("products");
/*********** Process each JSON Node ************/
int lengthJsonArr = jsonproduct.length();
for (int i = 0; i < lengthJsonArr; i++) {
JSONObject c = jsonproduct.getJSONObject(i);
itemcode.add(c.get("Code").toString());
item.add(c.get("Name").toString());
quantity.add("");
category.add("CategoryCode");
}
错误是
org.json.JSONException: 值 [{"categories":[{......................all json}]
我的 json 就像
[ { 类别{[ "a":"s" "b":"g" }, { "a":"s" "b":"g" } ]},
产品{[ "a":"s" "b":"g" }, { "a":"s" "b":"g" } ]} ]
我的 Json 网络服务网址 [webservice][1]
请帮助我如何解决此问题 提前致谢