Hello I'm new to android studio and I'm currently trying to figure out how to parse this json file: http://stman1.cs.unh.edu:6191/games into a 2d array. I can't seem to figure out a simple way of doing this.
I'm not sure exactly why object types are returned by the JsonObject. I know it can't be converted to an int because it's likely an array of ints but I also can't get that array because it doesn't have a name like the outer array.
public void onResponse(JSONObject response) {
try {
JSONArray jsonArray = response.getJSONArray("grid");
for( int i=0; i < jsonArray.length(); i++ ){
JSONObject num = jsonArray.getJSONObject(i);
gridVals[i] = num.getInt();
}
} catch (JSONException e) {
e.printStackTrace();
}
}