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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:20:50+00:00 2026-05-24T01:20:50+00:00

In my app I need to obtain some data from server. In eclipse I

  • 0

In my app I need to obtain some data from server. In eclipse I receive data like this :

[{"id_category":"1","category_name":"Cool"},{"id_category":"2","category_name":"Glamor"},{"id_category":"3","category_name":"Funky"},{"id_category":"4","category_name":"Crazy"},{"id_category":"5","category_name":"David Guetta"}] without any name.

I tried something like this :

if (response != null) {
                responseBody = EntityUtils.toString(response.getEntity());
                System.out
                        .println("Rezultat de la server pentru a afla categoriile:"
                                + responseBody);
try {
                    final String r = response.toString();
String name = json.getString("category name");
System.out.println("One category"+name);
                } catch (JSONException e) {
                    // do nothing
                } catch (FacebookError e) {
                    e.getMessage();
                }

but nothing happens. How can I get id_category and category_name from my response?
Can anyone help me? Thanks in advance.

  • 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-24T01:20:51+00:00Added an answer on May 24, 2026 at 1:20 am

    This is how you parse JSON…I hope it works.

        JSONArray jArray = new JSONArray(r);
        for(int i=0;i<jArray.length();i++){
                JSONObject jsdata = jArray.getJSONObject(i);
                String myString = jsdata.getString("id_category");
                String myString2 = jsdata.getString("category_name");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an app wherein I obtain the json data from a url
I need to pass some data from a classic ASP application to my ASP.NET
For my GAE app I need to do some natural language processing to extract
I'm currently working on a Silverlight app and need to convert XML data into
I need to obtain a Social Security Number in my app, but I don't
My app allows user to obtain picture/image from camera/photo gallery and then the app
I have an app need to load photos from simulator photo library. After I
Hej, I have some data shipped out with the app which shall be copied
I have a purely native Android NDK app, and need to render some text
How do I obtain the iTunes Store app description from within my iPhone app?

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.