私はjsonデータを解析する必要があるという点でAndroidアプリを開発しています。私のjson形式は次のようなものです:
[
{
"product": {
"id": "120",
"name":"prod1name"
"description":"prod1description"
},
"product": {
"id": "121",
"name":"prod2name"
"description":"prod2description"
}
}
]
私の解析コード:
JSONArray array=new JSONArray(text);
for(int i=0;i<array.length();i++)
{
JSONObject json = array.getJSONObject(i);
myJson = json.getJSONObject("product");
productname.add(myJson.getString("name"));
productdesc.add(myJson.getString("description"));
}
今、私の疑問は次のとおりです。次のようにデータを取得するものはありますか: id=120 の製品名を取得 する