JSON file reading an array in Java AndroidStudio [closed]

Tags: , ,

I’m trying to read data from JSON file in AndroidStudio with a format as follows:

"records": [

I want to have objects containing int, String, String (new Object for each row). Does someone know how to write that?


This may help

JSONObject jsonObject ;// your json body 
    try {
        JSONArray jsonArray = jsonObject.getJSONArray("records");
        for (int i = 0; i < jsonArray.length(); i++) {
            JSONArray jArray = jsonArray.getJSONArray(i);// for each row in records([2,"name2","0,74"])

    } catch (JSONException e) {

Source: stackoverflow