0

I have a JSON data and i want to count the json data if have a same value ?

{
"data": [
        {
            "ID": 47,
            "desa": "Benteng Selatan",
            "kecamatan": "Benteng"
        },
        {
            "ID": 48,
            "desa": "Benteng Selatan",
            "kecamatan": "Benteng"
        },
        {
           "ID": 49,
            "desa": "Benteng Utara",
            "kecamatan": "Benteng"
        },
        {
            "ID": 50,
            "desa": "Garaupa",
            "kecamatan": "Bontomatene"
        }
    ]
}

And show in text view, like : Benteng Selatan and Benteng : 2, Benteng Utara and Benteng : 1, Garaupa and Bontomantene : 1

rangga ario
  • 19
  • 1
  • 8

1 Answers1

0

By parsing your json string create an ArrayList Of Object. See parsing here.

Then use the following method to group your data by value.

Rasel
  • 5,488
  • 3
  • 30
  • 39