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: 値 [{"カテゴリ":[{......................すべての json}]
私のjsonは
[ { カテゴリ{[ "a":"s" "b":"g" }, { "a":"s" "b":"g" } ]},
product{[ "a":"s" "b":"g" }, { "a":"s" "b":"g" } ]} ]
MY Json Web サービス URL [Web サービス][1]
この問題を解決する方法を教えてください よろしくお願いします