title: Parsing a complex JSON response
body: <p>I have written a json parser class to parse a simple json array that is returned from a http request. how do i modify the code below to  get data from object "entries" from the url
  <a href="https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&amp;q=http://ramrojob.com/feed" rel="nofollow">Request URL</a>  </p>
  
  <pre><code>try {
              JSONArray jArray = new JSONArray(result);
              JSONObject json_data = null;
                  for (int i = 0; i &lt; jArray.length(); i++) {
                  json_data = jArray.getJSONObject(i);
                  String title = json_data.getString("title");
                  String link=json_data.getString("link");
                  HashMap&lt;String, String&gt;map=new HashMap&lt;String, String&gt;();
                  map.put("title",title);
                  map.put("link",link);
                  jlist.add(map);
              }
  </code></pre>
  
  <p><strong>Response:</strong></p>
  
  <pre><code>{
      "responseData": {
          "feed": {
              "feedUrl": "http://ramrojob.com/feed",
              "title": "Ramro Job",
              "link": "http://ramrojob.com",
              "author": "",
              "description": "...your pathway to success",
              "type": "rss20",
              "entries": [
                  {
                      "title": "Monitoring and Evaluation Specialist Wanted at GRM International",
                      "link": "http://ramrojob.com/job/2013/05/12/monitoring-and-evaluation-specialist-wanted-at-grm-international.html",
                      "author": "Bandana Aryal",
                      "publishedDate": "Sun, 12 May 2013 01:10:24 -0700",
                      "contentSnippet": "Key Responsibilities Under direction of the Team Leader, responsible for the design and roll out of programme M&amp;#38;E plan, ...",
                      "content": "&lt;p&gt;&lt;strong&gt;Key Responsibilities&lt;/strong&gt;&lt;/p&gt;\n&lt;ul&gt;\n&lt;li&gt;Under direction of the Team Leader, responsible for the design and roll out of programme M&amp;amp;E plan, including design of the logframe and key performance indicators.&lt;/li&gt;\n&lt;li&gt;Track programme progress against indicators and ensure early identification of any areas requiring remedial action.&lt;/li&gt;\n&lt;li&gt;Carry out site visits and provide M&amp;amp;E support and training for local partners.&lt;/li&gt;\n&lt;li&gt;Harmonise programme monitoring indicators and systems with national M&amp;amp;E systems.&lt;/li&gt;\n&lt;li&gt;Promote use of data to inform decision making and link evidence-based approaches to achievement of results.&lt;/li&gt;\n&lt;li&gt;Support operations research and specialised studies, such as client satisfaction, cost-effectiveness, and impact evaluation.&lt;/li&gt;\n&lt;li&gt;Solicit and manage local data collection and research teams, as needed.&lt;/li&gt;\n&lt;li&gt;Contribute to the preparation of regular progress reports, technical deliverables, presentations, and annual work plans.&lt;/li&gt;\n&lt;/ul&gt;\n&lt;p&gt;&lt;strong&gt;Qualifications&lt;/strong&gt;&lt;/p&gt;\n&lt;ul&gt;\n&lt;li&gt;Seven or more years of experience monitoring and evaluating reproductive health and family planning programmes, including promoting use of data for decision-making.&lt;/li&gt;\n&lt;li&gt;Strong technical grasp of relevant health issues: sexual and reproductive health; family planning; maternal, new-born, and child health; HIV and AIDS; and health equity.&lt;/li&gt;\n&lt;li&gt;Understanding of health market dynamics and the health system in Nepal.&lt;/li&gt;\n&lt;li&gt;Demonstrated experience working with government, private sector, and nongovernmental health sector partners in Nepal, at national and decentralised levels.&lt;/li&gt;\n&lt;li&gt;Experience supporting DFID, European Union, USAID, World Bank, or other donor-funded or government health programmes.&lt;/li&gt;\n&lt;li&gt;Strong quantitative and qualitative research and analysis skills.&lt;/li&gt;\n&lt;li&gt;Demonstrated experience with computerised management information systems, databases, MS Office, and other relevant skills.&lt;/li&gt;\n&lt;li&gt;Ability to graphically present data in ways that engage and influence target audiences.&lt;/li&gt;\n&lt;li&gt;Knowledge of in-country and international guidelines pertaining to research ethics.&lt;/li&gt;\n&lt;li&gt;Strong personal qualities, including integrity, commitment to excellence, equality, openness, inclusiveness, and collegiality.&lt;/li&gt;\n&lt;li&gt;Excellent written and spoken English required, local languages are a distinct advantage.&lt;/li&gt;\n&lt;li&gt;Advanced degree/s in relevant discipline preferred.&lt;/li&gt;\n&lt;li&gt;Nepali nationals strongly encouraged to apply.&lt;/li&gt;\n&lt;/ul&gt;\n&lt;p&gt;The post &lt;a href=\"http://ramrojob.com/job/2013/05/12/monitoring-and-evaluation-specialist-wanted-at-grm-international.html\"&gt;Monitoring and Evaluation Specialist Wanted at GRM International&lt;/a&gt; appeared first on &lt;a href=\"http://ramrojob.com\"&gt;Ramro Job&lt;/a&gt;.&lt;/p&gt;",
                      "categories": [
                          "Uncategorized"
                      ]
                  },
                  {
                      "title": "Director of Finance and Admin Wanted at Abt Associates",
                      "link": "http://ramrojob.com/job/2013/05/12/director-of-finance-and-admin-wanted-at-abt-associates.html",
                      "author": "Bandana Aryal",
                      "publishedDate": "Sun, 12 May 2013 01:02:28 -0700",
                      "contentSnippet": "Job Responsibilities: Abt Associates seeks a Director of Finance and Administration for an upcoming DFID-funded family planning ...",
                      "content": "&lt;p&gt;&lt;strong&gt;Job Responsibilities:&lt;/strong&gt;&lt;/p&gt;\n&lt;p&gt;Abt Associates seeks a Director of Finance and Administration for an upcoming DFID-funded family planning program in Nepal. The initiative will work with the Ministry of Health and Population to increase use of modern high-quality family planning methods by the most vulnerable and excluded women by supply innovative and high quality family planning services. The program will also work with the Ministry of Health and Population to ensure better choices and availabilites of reproductive health commodities.&lt;/p&gt;\n&lt;p&gt;The Director of Finance and Administration will be responsible for the management of the contract, procurement, subcontracting, financial management and reporting, and general administrative support of the program. S/he will develop and track budgets, manage payroll and vendor relations, and control all financial transactions and reporting, both for the client and for Abt Associates headquarters.&lt;/p&gt;\n&lt;p&gt;Specific responsibilities will include:&lt;/p&gt;\n&lt;ul&gt;\n&lt;li&gt;Ensure compliance with terms and references in the contract;&lt;/li&gt;\n&lt;li&gt;Develop and implement financial and administrative policies and procedures that meet project requirements and donor regulations;&lt;/li&gt;\n&lt;li&gt;Create and maintain financial reporting and tracking systems, and provide financial performance updates on project activities;&lt;/li&gt;\n&lt;li&gt;Prepare budgets and revenue plans for project programming and corporate reporting;&lt;/li&gt;\n&lt;li&gt;Oversee financial and HR administration of project (purchase requisitions, consulting agreements, vendor invoices, client invoices, payroll etc.);&lt;/li&gt;\n&lt;li&gt;Manage vendors and subcontractors in compliance with Abt and DfID policies and regulations;&lt;/li&gt;\n&lt;li&gt;Supervise all financial and administrative staff;&lt;/li&gt;\n&lt;li&gt;Provide training to field staff on project procedures as well as building skill-levels of project staff in the area of finance, administration, and project management.&lt;/li&gt;\n&lt;/ul&gt;\n&lt;p&gt;&lt;strong&gt;Skills Prerequisites:&lt;/strong&gt;&lt;/p&gt;\n&lt;ul&gt;\n&lt;li&gt;Bachelor’s Degree (minimum) or master’s degree (preferred) in Business, Finance, Accounting or other relevant field;&lt;/li&gt;\n&lt;li&gt;10 years of experience in administration, project management and/or financial management;&lt;/li&gt;\n&lt;li&gt;5 years of experience working with international donors in a development setting;&lt;/li&gt;\n&lt;li&gt;Experience with DfID contracts desirable;&lt;/li&gt;\n&lt;li&gt;Strong analytical and computer skills, with emphasis on budgeting and financial analysis;&lt;/li&gt;\n&lt;li&gt;Excellent inter-personal, communication and organizational skills;&lt;/li&gt;\n&lt;li&gt;Capabilities in Nepali or other South Asian languages are desirable.&lt;/li&gt;\n&lt;/ul&gt;\n&lt;p&gt;The post &lt;a href=\"http://ramrojob.com/job/2013/05/12/director-of-finance-and-admin-wanted-at-abt-associates.html\"&gt;Director of Finance and Admin Wanted at Abt Associates&lt;/a&gt; appeared first on &lt;a href=\"http://ramrojob.com\"&gt;Ramro Job&lt;/a&gt;.&lt;/p&gt;",
                      "categories": [
                          "Uncategorized"
                      ]
                  },
                  {
                      "title": "Technical Director Wanted at Family Planning Nepal",
                      "link": "http://ramrojob.com/job/2013/05/12/technical-director-wanted-at-family-planning-nepal.html",
                      "author": "Bandana Aryal",
                      "publishedDate": "Sun, 12 May 2013 00:57:03 -0700",
                      "contentSnippet": "Skills Prerequisites: Masters Degree (minimum) in Public Health, Business Administration or related relevant discipline Ten ...",
                      "content": "&lt;p&gt;&lt;strong&gt;Skills Prerequisites:&lt;/strong&gt;&lt;/p&gt;\n&lt;ul&gt;\n&lt;li&gt;Masters Degree (minimum) in Public Health, Business Administration or related relevant discipline&lt;/li&gt;\n&lt;li&gt;Ten years (10) of relevant professional experience, including sales or marketing, and strong business acumen in areas of business process and analysis would be highly valued&lt;/li&gt;\n&lt;li&gt;Eight (8) years experience working in health sector projects or initiatives involving multiple stakeholder groups, including NGOs and the private health sector&lt;/li&gt;\n&lt;li&gt;Successful prior experience in social marketing or franchising&lt;/li&gt;\n&lt;li&gt;Proven track record of building and sustaining effective partnerships, advocating effectively and communicating to various constituencies&lt;/li&gt;\n&lt;li&gt;Ability to coordinate in a dynamic environment&lt;/li&gt;\n&lt;li&gt;Substantial experience in building capacity in the non-state/private sector&lt;/li&gt;\n&lt;li&gt;Ability to independently plan and execute complex tasks while addressing daily management details and remaining organized and focused on long-term deadlines and strategies&lt;/li&gt;\n&lt;li&gt;Solid professional reputation and strong, demonstrated interpersonal skills&lt;/li&gt;\n&lt;li&gt;Professional working experience in Nepal desirable&lt;/li&gt;\n&lt;li&gt;Fluency in Nepali desirable&lt;/li&gt;\n&lt;li&gt;Excellent written and oral presentation skills in English&lt;/li&gt;\n&lt;/ul&gt;\n&lt;p&gt;The post &lt;a href=\"http://ramrojob.com/job/2013/05/12/technical-director-wanted-at-family-planning-nepal.html\"&gt;Technical Director Wanted at Family Planning Nepal&lt;/a&gt; appeared first on &lt;a href=\"http://ramrojob.com\"&gt;Ramro Job&lt;/a&gt;.&lt;/p&gt;",
                      "categories": [
                          "Uncategorized"
                      ]
                  },
                  {
                      "title": "Monitoring and Evaluation Analyst Wanted at UN Women",
                      "link": "http://ramrojob.com/job/2013/05/12/monitoring-and-evaluation-analyst-wanted-at-un-women.html",
                      "author": "Bandana Aryal",
                      "publishedDate": "Sun, 12 May 2013 00:46:37 -0700",
                      "contentSnippet": "Core Competencies Knowledge of current practices in the area of monitoring and evaluation, knowledge management Promotes the ...",
                      "content": "&lt;p&gt;&lt;b&gt;Core Competencies&lt;/b&gt;&lt;/p&gt;\n&lt;ul&gt;\n&lt;li&gt;Knowledge of current practices in the area of monitoring and evaluation, knowledge management&lt;/li&gt;\n&lt;li&gt;Promotes the vision, mission, and strategic goals of UN Women;&lt;/li&gt;\n&lt;li&gt;Displays cultural, gender, religion, race, nationality and age sensitivity and adaptability&lt;/li&gt;\n&lt;li&gt;Fostering innovation and empowerment&lt;/li&gt;\n&lt;li&gt;Working in teams at all levels&lt;/li&gt;\n&lt;li&gt;Communicating information and ideas/knowledge sharing&lt;/li&gt;\n&lt;li&gt;Analytical and strategic thinking/results orientation/commitment to Excellence&lt;/li&gt;\n&lt;/ul&gt;\n&lt;p&gt;&lt;span style=\"text-decoration:underline\"&gt;&lt;strong&gt;Qualifications and Experience:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;\n&lt;ul&gt;\n&lt;li&gt;Master’s Degree in Economics, Management, Rural Development, Social Sciences, or related field. Additional certification in statistics, MIS management and Monitoring and Evaluation will be considered as an asset.&lt;/li&gt;\n&lt;li&gt;Two years of relevant professional experience in the field of rights based monitoring and evaluation;&lt;/li&gt;\n&lt;li&gt;Experience in the management of gender equality and women’s empowerment programmes or analytic work in gender and development, gender analysis and/or human rights;&lt;/li&gt;\n&lt;li&gt; Good knowledge of rights-based approach and result-based management.&lt;/li&gt;\n&lt;li&gt; Experience related to UN Women’s mandate and activities would be an added advantage;&lt;/li&gt;\n&lt;li&gt; Sound knowledge of international standards on human rights, women’s rights and related instruments;&lt;/li&gt;\n&lt;li&gt;A proven ability to liaise with a myriad of stakeholders and partners, including government, civil society, international organizations and grassroots organizations&lt;/li&gt;\n&lt;/ul&gt;\n&lt;p&gt;The post &lt;a href=\"http://ramrojob.com/job/2013/05/12/monitoring-and-evaluation-analyst-wanted-at-un-women.html\"&gt;Monitoring and Evaluation Analyst Wanted at UN Women&lt;/a&gt; appeared first on &lt;a href=\"http://ramrojob.com\"&gt;Ramro Job&lt;/a&gt;.&lt;/p&gt;",
                      "categories": [
                          "The Himalayan Times"
                      ]
                  }
              ]
          }
      },
      "responseDetails": null,
      "responseStatus": 200
  }
  </code></pre>
  
  <p>This didn't work either...or am i missing something?</p>
  
  <pre><code> try {
                  JSONObject obj = new JSONObject(result);
                  JSONObject responseJson=obj.getJSONObject("responseData");
                  JSONObject feedjson=responseJson.getJSONObject("feed");
                  JSONArray entriesJSON=feedjson.getJSONArray("entries");
                  JSONObject json_data = null;
                  Log.d("parseJson","sad");
                  for (int i = 0; i &lt; entriesJSON.length(); i++) {
                      json_data = entriesJSON.getJSONObject(i);
                      String title=json_data.getString("title");
                      String link=json_data.getString("link");
                      HashMap&lt;String, String&gt;map=new HashMap&lt;String, String&gt;();
                      map.put("title",title);
                      map.put("link", link);
                      jlist.add(map);
                  }
              }
  </code></pre>
  
  <p>My Logcat log:</p>
  
  <pre><code>05-13 15:50:27.963: W/dalvikvm(12494): threadid=11: thread exiting with uncaught exception (group=0x410a42a0)
  05-13 15:50:28.033: E/AndroidRuntime(12494): FATAL EXCEPTION: AsyncTask #1
  05-13 15:50:28.033: E/AndroidRuntime(12494): java.lang.RuntimeException: An error occured while executing doInBackground()
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at android.os.AsyncTask$3.done(AsyncTask.java:299)
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at java.lang.Thread.run(Thread.java:856)
  05-13 15:50:28.033: E/AndroidRuntime(12494): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at android.os.Handler.&lt;init&gt;(Handler.java:121)
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at android.widget.Toast$TN.&lt;init&gt;(Toast.java:361)
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at android.widget.Toast.&lt;init&gt;(Toast.java:97)
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at android.widget.Toast.makeText(Toast.java:254)
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at np.com.smarttech.jobslist.MainActivity.parseJson(MainActivity.java:157)
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at np.com.smarttech.jobslist.MainActivity.access$0(MainActivity.java:104)
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at np.com.smarttech.jobslist.MainActivity$JobThread.doInBackground(MainActivity.java:77)
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at np.com.smarttech.jobslist.MainActivity$JobThread.doInBackground(MainActivity.java:1)
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at android.os.AsyncTask$2.call(AsyncTask.java:287)
  05-13 15:50:28.033: E/AndroidRuntime(12494):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
  05-13 15:50:28.033: E/AndroidRuntime(12494):    ... 5 more
  </code></pre>