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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:35:49+00:00 2026-06-11T06:35:49+00:00

Possible Duplicate: JSON Array iteration in Android/Java I am developing an app where i

  • 0

Possible Duplicate:
JSON Array iteration in Android/Java

I am developing an app where i am using the following JSONWeb Services Code. Everything is working good and getting response as JSON Array. I am not having any idea how to convert JSON Array to string. The response i am getting is in the following pattern..

Json Respone

[
{
     "Id":101,
     "Movie":"xxxxx",
     "Available":
        [             
            {
              "date":"31-08-2012",
              "timings":
                  [
                   "10:15",
                   "10:30",
                   "10:40"
                   ]
            },
            {
                "date":"1-09-2012",
                "timings":
                    [
                     "10:15",
                     "10:30",
                     "10:40"
                     ]
            }
        ]
}
]

This is the response i am getting. Can anyone suggest me how to convert the following Json Response to string in android and i want to display that data in listview in android native.

  • 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-11T06:35:51+00:00Added an answer on June 11, 2026 at 6:35 am

    look at this sample and convert per your need

    ps: a json array is one which starts with [ and ends with ]
    a json object starts with{ and ends with } so in your case available is a json array and its 1 st object contains a json string date and another json array timings

    JSONArray ja =jso.getJSONArray("Available");
    
    
    
    
    
                for (int i = 0; i < ja.length(); i++) {
                    JSONObject jobj=ja.getJSONObject(i);
                    xyz[i]=jobj.getString("date");
                    abcd[i]=jobj.getJSONArray("timings").tostring;
    
    
                }
    
    
                }
    

    edit:

        ArrayList<HashMap<String, String>> contactList = new ArrayList<HashMap<String, String>>();
       JSONParser jParser = new JSONParser(); 
       JSONArray json = jParser.getJSONFromUrl(url);
       try { for (int i=0; i< json.length(); i++) {
        JSONObject details = json.getJSONObject(i);
        String id = details.getString("Id");
        String name = details.getString("Name");
        HashMap<String, String> map = new HashMap<String, String>(); 
       map.put(TAG_ID, id); map.put(TAG_NAME, name);
    
    
        contactList.add(map)
        JSONArray ja=details.getJSONArray("Available");
    
            for (int i = 0; i < ja.length(); i++) {
                JSONObject jobj=ja.getJSONObject(i);
               String a =jobj.getString("date");
              String b   =jobj.getJSONArray("timings").tostring;
        HashMap<String, String> map2 = new HashMap<String, String>(); 
       map2.put("a", a); map2.put("b", b);
        contactList.add(map2)
    
            }
    
         }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: JSON Array iteration in Android/Java I am fetching JSON string from server
Possible Duplicate: Taking .get json string, turn into array? Im using the following to
Possible Duplicate: Converting XML to JSON using Python? I'm doing some work on App
Possible Duplicate: Array unique values Get unique results from JSON array using jQuery Im
Possible Duplicate: JSON Parsing in Android As I find out I need to use
Possible Duplicate: Serializing to JSON in jQuery I'm using jquery as a library in
Possible Duplicate: Can I comment a JSON file? We are using a .json file
Possible Duplicate: How can I parse JSON in Google App Engine? json module was
Possible Duplicate: Sending and Parsing JSON in Android I am fetching JSON Data from
Possible Duplicate: Parse JSON with jQuery I tried to parse the following JSON File.

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.