Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid create a JSON array of JSON Objects
    primarykey
    data
    text
    <p>hi does anyone know how to create a Array that contains objects that in each objects contain several objects? i just can't seem to get my head round it</p> <p>the structure should look like this</p> <pre><code>Array{[object]{subobject,subobject} [object]{subobject,subobject} } </code></pre> <p>heres what i have so far</p> <pre><code>JSONObject obj = new JSONObject(json2); JSONObject objData = obj.getJSONObject("data"); fixturesArray = objData.getJSONArray("fixtures"); JSONArray FixArray = new JSONArray(); for(int t = 0; t &lt; fixturesArray.length(); t++){ JSONObject fixObj = fixturesArray.getJSONObject(t); String Matchdate = fixObj.getString("matchdate"); JSONObject DateObj = DateObj.put(Matchdate, DateObj); </code></pre> <p>heres my JSON essentially what i have if is a feed of fixtures i need to order them in to arrays of dates</p> <pre><code>{ "code":200, "error":null, "data":{ "fixtures":[ { "kickoff":"15:00:00", "matchdate":"2012-07-28", "homescore":null, "awayscore":null, "attendance":null, "homepens":null, "awaypens":null, "division_id":"5059", "division":"Testing 1", "comp":"LGE", "location":null, "fixture_note":null, "hometeam_id":"64930", "hometeam":"Team 1", "awayteam_id":"64931", "awayteam":"Team 2" }, { "kickoff":"15:00:00", "matchdate":"2012-07-28", "homescore":null, "awayscore":null, "attendance":null, "homepens":null, "awaypens":null, "division_id":"5059", "division":"Testing 1", "comp":"LGE", "location":null, "fixture_note":null, "hometeam_id":"64930", "hometeam":"Team 1", "awayteam_id":"64931", "awayteam":"Team 2" } ] } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload