私はAndroid開発に不慣れで、簡単な質問に違いありませんが、理解できません。私のアプリは次の形式のjsonを取得します:
[
{
'src':1,
'title':'The Black Eyed Peas - Lets Get It Started',
'id':1,
'slots':[0,10],
'prev':[0,1,2,3]
},
{
'src':2,
'title':'Carly Ray Jepsen - Call Me Maybe',
'id':2,
'slots':[0,10],
'prev':[0,1,2,3]
},
{
'src':3,
'title':'Kris Kross - Jump',
'id':3,
'slots':[0,10],
'prev':[0,1,2,3]
}, .... //several identical
]
次にそれを解析します。
for(int i = 0; i<json.length(); i++)
{
JSONObject jo = (JSONObject) json.get(i);
String src = jo.getString("src");
String title = jo.getString("title");
String id = jo.getString("id");
//What should do next?
}
使用する新しいデータ型を作成する必要があります。どのように私はこれをしなければなりませんか?PS私の悪い英語でごめんなさい