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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:30:38+00:00 2026-06-10T01:30:38+00:00

this the JSON data that i want to parse in my application: { viewdeal:[

  • 0

this the JSON data that i want to parse in my application:

{
  "viewdeal":[
  {
     "viewdeal1":{
        "teetimeId":"33",
        "golfcourseId":"127",
        "offers":"descount of $2",
        "time":"8\/7\/pm",
        "amount":"90",
        "month":"august",
        "year":"2012",
        "date":"21",
        "day":"monday",
        "created_date":"0",
        "golfcourse_name":"SilverHorn Golf Club"
     },
     "msz":"Book"
   }
 ]
}

The code that i am using to parse the JSON data is:

JsonParser jParser = new JsonParser();
JSONObject json = jParser.getJSONfromUrl("http://mygogolfteetime.com/iphone/viewdeal/127");
JSONArray viewdeal = json.getJSONArray(TAG_VWDL);
                vwdlsList.clear();
                for(int i=0; i<viewdeal.length(); i++)
                {
                    JSONObject v1 = viewdeal.getJSONObject(i);
                    msz = v1.getString(TAG_MSZ);
                    viewdeal1 = v1.getString(TAG_VWDL1);
                    JSONArray viewdeal1 = json.getJSONArray(TAG_VWDL1); 
                    for(int j=0; j<viewdeal1.length(); j++)
                    {
                        JSONObject v2 = viewdeal.getJSONObject(j);
                        teetimeId = v2.getString(TAG_TTIMEID);
                        golfcourseId = v2.getString(TAG_GLFCRSID);
                        offers = v2.getString(TAG_OFR);
                        time = v2.getString(TAG_TIME);
                        amount = v2.getString(TAG_AMNT);
                        month = v2.getString(TAG_MNTH);
                        year = v2.getString(TAG_YEAR);
                        date = v2.getString(TAG_DATE);
                        day = v2.getString(TAG_DAY);
                        created_date = v2.getString(TAG_CRTDATE);
                        golfcourse_name = v2.getString(TAG_GLFCRSNAME);
                    }

                    HashMap<String, String> map = new HashMap<String, String>();
                    map.put(TAG_TTIMEID, teetimeId);
                    map.put(TAG_GLFCRSID, golfcourseId);
                    map.put(TAG_MSZ, msz);
                    map.put(TAG_OFR, offers);
                    map.put(TAG_TIME, time);
                    map.put(TAG_AMNT, amount);
                    map.put(TAG_MNTH, month);
                    map.put(TAG_YEAR, year);
                    map.put(TAG_DATE, date);
                    map.put(TAG_DAY, day);
                    map.put(TAG_CRTDATE, created_date);
                    map.put(TAG_GLFCRSNAME, golfcourse_name);

                    vwdlsList.add(map);
                }
            }

In the above code i am able to parse the value of msz and viewdeal1 but when i try to parse the remaining values that are in the viewdeal1 i receive the following message in my LogCat:

08-22 12:03:46.034: V/GoGolf(1178): org.json.JSONException: No value for viewdeal1

How can I parse the remaining values that are in the viewdeal1..

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-06-10T01:30:40+00:00Added an answer on June 10, 2026 at 1:30 am

    Try this…

    nParser jParser = new JsonParser();
    JSONObject json = jParser.getJSONfromUrl("http://mygogolfteetime.com/iphone/viewdeal/127");
    JSONArray viewdeal = json.getJSONArray(TAG_VWDL);
                    vwdlsList.clear();
                    for(int i=0; i<viewdeal.length(); i++)
                    {
    
                 ---->> **JSONObject v1= viewdeal.getJSONObject(i).getJSONObject("viewdeal1");**
    
                             .....
                             .....      
                    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have about 7000 lines of JSON data that I want to parse. An
I am working in android. I want to parse my json data. This is
Well ive got this code that creates a table from JSON data. If a
I normally get Facebook JSON data that look like this (taken from an example):
I want to load JSON data through multithreading and parse it to NSDictionary, have
I want to do an Application test that parses some json, stores to core
Currently, I have json data of several twitter feeds that I parse to fill
How can I loop through this json data without referring to the data items
Let's say i have this json data. How to transform the tags to a
This is my JSON data: { ACT: Australian Capital Territory, NSW: New South Wales,

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.