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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:49:06+00:00 2026-06-14T12:49:06+00:00

Possible duplicate How to parse a JSON and turn its values into an Array?

  • 0

Possible duplicate

How to parse a JSON and turn its values into an Array?

[
   [
      "sn1",
      "Liquid_level",
      "85"
   ],
   [
      "sn2",
      "Liquid_level,Temperature",
      "95"
   ],
   [
      "sn2",
      "Liquid_level,Temperature",
      "50"
   ],
   [
      "sn3",
      "Liquid_level",
      "85.7"
   ],
   [
      "sn4",
      "Liquid_level",
      "90"
   ],
   [
      "sn5",
      "Volt_meter",
      "4.5"
   ],
   [
      "sn6",
      "Temperature",
      "56"
   ],
   [
      "sn8",
      "Liquid_level",
      "30"
   ]
]

This is the data i want to get to a java array (to create a dynamic table to show data).

i can get a text value using this

String response = null;
            try {
                response = CustomHttpClient.executeHttpPost("http://test.tester.com/check.php", postParameters);
                String res=response.toString();}
  • 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-06-14T12:49:07+00:00Added an answer on June 14, 2026 at 12:49 pm

    As from How to parse a JSON and turn its values into an Array?:

    for your example:

    {'profiles': [{'name':'john', 'age': 44}, {'name':'Alex','age':11}]}
    

    you will have to do something of this effect:

    JSONObject myjson = new JSONObject(the_json);
    JSONArray the_json_array = myjson.getJSONArray("profiles");
    

    this returns the array object.

    Then iterating will be as follows:

        int size = the_json_array.length();
        ArrayList<JSONObject> arrays = new ArrayList<JSONObject>();
        for (int i = 0; i < size; i++) {
          JSONObject another_json_object = the_json_array.getJSONObject(i);
                //Blah blah blah...
                arrays.add(another_json_object);
        }
    
    //Finally
    JSONObject[] jsons = new JSONObject[arrays.size()];
    arrays.toArray(jsons);
    
    //The end...
    

    You will have to determine if the data is an array (simply checking
    that charAt(0) starts with [ character).

    Hope this helps.

    Credits to https://stackoverflow.com/users/251173/the-elite-gentleman

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

Sidebar

Related Questions

Possible Duplicate: Taking .get json string, turn into array? Im using the following to
Possible Duplicate: Parse query string into an array What's the fastest method , to
Possible Duplicate: Parse query string into an array How can I explode a string
Possible Duplicate: How to parse JSON in JavaScript { data: [ { name: JoongBum
Possible Duplicate: How to parse JSON in JavaScript I have this JSON string: [{title:
Possible Duplicate: How can I parse JSON in Google App Engine? json module was
Possible Duplicate: jQuery won't parse my JSON from AJAX query So I have parsed
Possible Duplicate: How to parse JSON in JavaScript Hi I have to parse the
Possible Duplicate: Parse JSON with jQuery I tried to parse the following JSON File.
Possible Duplicate: Parse Json in php I was looking for this awnser but couldnt

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.