-5

I need to parse this json. How can i parse? I use JSONOBJECT/JSONARRAY. But i can't parse please help me..

     {
        "answers": {
            "Kırmızı": [
                5,
                15,
                25,
                30,
                25
            ],
            "Mavi": [
                10,
                20,
                5,
                35,
                30
            ]

        }

}
shadygoneinsane
  • 2,226
  • 1
  • 24
  • 47
secret35
  • 56
  • 7
  • More code needed... what have you actually tried? Just in case, every time you see a curly brace { that's an jsonObject and with [ you'll have to parse it as a jsonArray – D Ie Mar 17 '17 at 07:11
  • 1
    Possible duplicate of [How to parse JSON in Android](http://stackoverflow.com/questions/9605913/how-to-parse-json-in-android) – shadygoneinsane Mar 17 '17 at 07:13
  • `But i can't parse` no, you can. Show what you've tried, and we'll help to fix it. – Vladyslav Matviienko Mar 17 '17 at 07:27

1 Answers1

1

How can i JSON parsing on Android

Try this

  JSONObject json = new JSONObject(jsonString);    // create JSON obj from string
    JSONObject answers = json.getJSONObject("answers");
    JSONArray kirmizi = answers.getJSONArray("Kirmizi");
    JSONArray mavi = answers.getJSONArray("Mavi");
Darish
  • 11,032
  • 5
  • 50
  • 70