Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7012745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:17:44+00:00 2026-05-27T22:17:44+00:00

I am working in android. I want to parse my json data. This is

  • 0

I am working in android. I want to parse my json data.

This is my json data:-

{

“response”:{

  "groups":[

     {

        "type":"nearby",
        "name":"Nearby",
        "items":[
           {
              "id":"4ed0c8f48231b9ef88fe5f09",
              "name":"Banayan Tree School",
              "contact":{

              },
              "location":{
                 "lat":26.857954980225713,
                 "lng":75.76602927296061,
                 "distance":510
              },
              "categories":[
                 {
                    "id":"4bf58dd8d48988d1a8941735",
                    "name":"General College & University",
                    "pluralName":"General Colleges & Universities",
                    "shortName":"Other - Education",
                    "icon":"https:\/\/foursquare.com\/img\/categories\/education\/default.png",
                    "parents":[
                       "Colleges & Universities"
                    ],
                    "primary":true
                 }
              ],
              "verified":false,
              "stats":{
                 "checkinsCount":5,
                 "usersCount":4,
                 "tipCount":0
              },
              "hereNow":{
                 "count":0
              }
           }

        ]
     }
  ]

}
}

i want to use icon to show icon in imageview. please suggest me how can i get this icon value and how can i user this icon url in imageview.

Thank you in advance.

i am trying this, but still it is creating error:-
this is my code:- but still is creating error:-

JSONArray groups= (JSONArray) jsonObj.getJSONObject(“response”).getJSONArray(“groups”);

int length= groups.length(); if (length > 0){ for (int i = 0; i < length; i++)

{

 JSONObject group= (JSONObject) groups.get(i); JSONArray items =(JSONArray) group.getJSONArray("items"); 

for (int j = 0; j < items.length(); j++)

{

JSONObject item = (JSONObject) items.get(j);

JSONObject iconobject=(JSONObject) item.getJSONObject(“categories”);//this is creating error that JSON.typeMismatch

venue.icon=iconobject.getString(“icon”);

}}}}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:17:45+00:00Added an answer on May 27, 2026 at 10:17 pm

    Try this:

    try {
        JSONArray jArray = new JSONArray(result);
        // get into the 'groups' array
        JSONObject jData = jArray.getJSONObject(0);
        JSONArray jGroupsArray = jData.getJSONArray("groups");
        // get into the 'items' array
        jData = jArray.getJSONObject(2);
        JSONArray jItemsArray = jData.getJSONArray("items");
        // get into the 'categories' array
        jData = jArray.getJSONObject(4);
        JSONArray jCategoriesArray = jData.getJSONArray("categories");
        // get into the 'icon' value as String and use it as you please
        jData = jArray.getJSONObject(4);
        String iconURL = jData.getString("icon");
    } catch (JSONException e) {
        Log.e(Constants.LOG_TAG, "Error parsing data", e);
    }
    

    Hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on an android application in which I want to parse an
I am working in android.. i want to move my text in animation. this
i am working with android and using xmlpullparser in android to parse an xml
I'm working on android unity3d project where I want to post some stuff to
I am working in android. I want to add functionality of seekbar in my
I am working in android. I want to draw a comment window. in which
I want to get fling gesture detection working in my Android application. What I
I am working on an Android project using Eclipse. I want to change the
i am working in android frameworks.i want to add an item to the existing
I am working on an android application.I want to pass values to soap webservice.But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.