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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:48:16+00:00 2026-05-31T16:48:16+00:00

I need to access as String all the single parameters contained in a complex

  • 0

I need to access as String all the single parameters contained in a complex Json.

for example String people=...;
String idPeople=...;
etc.

I have tried to use the JSONTokeners, as I have tried to search for similar question, and for simple json I haven’t problem but I don’t know how to get the parameters correctly from this:

{"id":1,"error":null,"result":
  {"nPeople":2,
    "people":[
            {"namePeople":"Inca",
             "power":"1235",
             "location":"asdfghjja",
             "idPeople":189,
             "mainItems":"brownGem",
             "verified":false,
             "description":"Lorem impsum bla bla",
             "linkAvatar":"avatar_12.jpg",
             "longitude":16.2434263,
             "latitude":89.355118},

            {"namePeople":"Maya",
             "power":"1235",
             "location":"hcjkjhljhl",
             "idPeople":119,
             "mainItems":"greenstone",
             "verified":false,
             "description":"Lorem impsum bla bla",
             "linkAvatar":"avatar_6.jpg",
             "longitude":16.2434263,
             "latitude":89.3551185}]
    }
}

NB the numbers of object in the array people is not always 2… and may contains 4 or more people object

  • 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-31T16:48:18+00:00Added an answer on May 31, 2026 at 4:48 pm

    I’ve not tried.
    But i guess it may work.

        JSONObject obj = new JSONObject(jsonString);
        String id = obj.getString("id");
        String error = obj.getString("error");
        JSONObject result = obj.getJSONObject("result");
        int nPeople = result.getInt("nPeople");
        JSONArray people = result.getJSONArray("people");
        for(int i = 0 ; i < people.length() ; i++){
            JSONObject p = (JSONObject)people.get(i);
            String namePeople = p.getString("namePeople");
            ...
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two different modules that need access to a single file (One will
I need to acces data by string index, like table('one') %returns 1 . Is
I need access to the uint64_t typedef from stdint.h in some wrapper code that
I can't create a NT account for everyone that need access to the reports.
I've got an app running maximized in a borderless window and need access to
I am working on a theme for Opencart and am finding I need access
I need to access the OpenGL state variables (such as the MVP matrices) in
I need to access some members marked internal that are declared in a third
I need to access RMI methods from a client front end. For different reasons,
i'm need to write a function that will flip all the characters of a

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.