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 6682879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:45:25+00:00 2026-05-26T04:45:25+00:00

I am making an app in which i am getting a string as response

  • 0

I am making an app in which i am getting a string as response from server side. that response is encoded in json. Now my problem is How to do json parsing of the encoded response from server side to decode it..
I am geting the following response from server

[“ekjyot@emobx.com”,”prince6179@gmail.com”,”facebook_514728069″]

It is in the form of an array.I want to decde it and display as textviws in my another activity.
I am using the following code:

                          HttpClient client = new DefaultHttpClient();
                String getURL =      "http://www.ondamove.it/English/mob/profile_friends.php?email="+Login.eMailId+"";
               HttpGet get = new HttpGet(getURL);
              HttpResponse responseGet = client.execute(get);  
              HttpEntity resEntityGet = responseGet.getEntity(); 


            if (resEntityGet != null) 
            {  

            String  s = EntityUtils.toString(resEntityGet);
            System.out.println(s);


            JSONArray ids = new JSONArray(s);

            for(int i=0; i< ids.length(); i++){
                   System.out.println(ids[]); //print each of the   string in json array.
            }

but it is giving me the error :
The type of the expression must be an array type but it resolved to JSONArray

how to resolve this issue.
can anyone help me over this?
thanks

  • 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-26T04:45:25+00:00Added an answer on May 26, 2026 at 4:45 am

    You can use JSONTokener to parse JSON documents for example:

    String json = "{"
             + "  \"query\": \"Pizza\", "
             + "  \"locations\": [ 94043, 90210 ] "
             + "}";
    
     JSONObject object = (JSONObject) new JSONTokener(json).nextValue();
     String query = object.getString("query");
     JSONArray locations = object.getJSONArray("locations");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a social app in which I am getting response from server
I am making an application (iPhone app) which gets information (jokes) from an RSS
I’m making a simple LOB app which loads data from an XML file and
I am working on making a mini app using Json parsing . Output I
I am making an android app which will have two services that will keep
I’m making an android app, which uses Google maps. One functionality is that the
I am making an app in which i am getting an array of images
I am making an app in which i need to implement calling emergency medical
I am practicing making a web app which tries to read the user's twitter
I'm making a Django web-app which allows a user to build up a set

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.