I am trying to parse json results from a website news feed. However the format seems to be very strange. I have tried to convert it to xml to get a closer look but I'm not sure how to access the fields. Please help
EDIT : I understand that there are different pages that show how to parse it but so far their solutions don't work for me.
EDIT :This is the error I get
java.lang.NullPointerException: Attempt to invoke virtual method 'org.json.JSONObject org.json.JSONObject.getJSONObject(java.lang.String)' on a null object reference
JSON Result (From the browser)
{  
   "responseData":{  
      "feed":{  
         "feedUrl":"http://www.abc.net.au/news/feed/51120/rss.xml",
         "title":"Just In",
         "link":"http://www.abc.net.au/news/justin/",
         "author":"",
         "description":"",
         "type":"rss20",
         "entries":[  
            {  
               "mediaGroups":[  
                  {  
                     "contents":[  
                        {  
                           "url":"http://www.abc.net.au/news/image/7388850-16x9-2150x1210.jpg",
                           "type":"image/jpeg",
                           "medium":"image",
                           "height":1210,
                           "width":2150,
                           "lang":"en-US",
                           "description":"New Zealand netball could actually benefit from its split from Australia. (Getty Images: Mead Norton)",
                           "thumbnails":[  
                              {  
                                 "height":105,
                                 "width":140,
                                 "url":"http://www.abc.net.au/news/image/7388850-4x3-140x105.jpg"
                              }
                           ]
                        },
                        {  
                           "url":"http://www.abc.net.au/news/image/7388850-4x3-940x705.jpg",
                           "type":"image/jpeg",
                           "medium":"image",
                           "height":705,
                           "width":940,
                           "lang":"en-US",
                           "description":"New Zealand netball could actually benefit from its split from Australia. (Getty Images: Mead Norton)",
                           "thumbnails":[  
                              {  
                                 "height":105,
                                 "width":140,
                                 "url":"http://www.abc.net.au/news/image/7388850-4x3-140x105.jpg"
                              }
                           ]
                        }}]}}, "responseDetails": null, "responseStatus": 200}
JSON Converted into XML for better view
<root>
<responseData>
    <feed>
        <feedUrl>http://www.abc.net.au/news/feed/51120/rss.xml</feedUrl>
        <title>Just In</title>
        <link>http://www.abc.net.au/news/justin/</link>
        <author></author>
        <description></description>
        <type>rss20</type>
        <entries>
            <mediaGroups>
                <contents>
                    <url>http://www.abc.net.au/news/image/7388850-16x9-2150x1210.jpg</url>
                    <type>image/jpeg</type>
                    <medium>image</medium>
                    <height>1210</height>
                    <width>2150</width>
                    <lang>en-US</lang>
                    <description>New Zealand netball could actually benefit from its split from Australia. (Getty Images: Mead Norton)</description>
                    <thumbnails>
                        <height>105</height>
                        <width>140</width>
                        <url>http://www.abc.net.au/news/image/7388850-4x3-140x105.jpg</url>
                    </thumbnails>
                </contents>
                <contents>
                    <url>http://www.abc.net.au/news/image/7388850-4x3-940x705.jpg</url>
                    <type>image/jpeg</type>
                    <medium>image</medium>
                    <height>705</height>
                    <width>940</width>
                    <lang>en-US</lang>
                    <description>New Zealand netball could actually benefit from its split from Australia. (Getty Images: Mead Norton)</description>
                    <thumbnails>
                        <height>105</height>
                        <width>140</width>
                        <url>http://www.abc.net.au/news/image/7388850-4x3-140x105.jpg</url>
                    </thumbnails>
                </contents>
                <contents>
                    <url>http://www.abc.net.au/news/image/7388850-3x2-940x627.jpg</url>
                    <type>image/jpeg</type>
                    <medium>image</medium>
                    <isDefault>true</isDefault>
                    <height>627</height>
                    <width>940</width>
                    <lang>en-US</lang>
                    <description>New Zealand netball could actually benefit from its split from Australia. (Getty Images: Mead Norton)</description>
                    <thumbnails>
                        <height>105</height>
                        <width>140</width>
                        <url>http://www.abc.net.au/news/image/7388850-4x3-140x105.jpg</url>
                    </thumbnails>
                </contents>
                <contents>
                    <url>http://www.abc.net.au/news/image/7388850-3x4-940x1253.jpg</url>
                    <type>image/jpeg</type>
                    <medium>image</medium>
                    <height>1253</height>
                    <width>940</width>
                    <lang>en-US</lang>
                    <description>New Zealand netball could actually benefit from its split from Australia. (Getty Images: Mead Norton)</description>
                    <thumbnails>
                        <height>105</height>
                        <width>140</width>
                        <url>http://www.abc.net.au/news/image/7388850-4x3-140x105.jpg</url>
                    </thumbnails>
                </contents>
                <contents>
                    <url>http://www.abc.net.au/news/image/7388850-1x1-1400x1400.jpg</url>
                    <type>image/jpeg</type>
                    <medium>image</medium>
                    <height>1400</height>
                    <width>1400</width>
                    <lang>en-US</lang>
                    <description>New Zealand netball could actually benefit from its split from Australia. (Getty Images: Mead Norton)</description>
                    <thumbnails>
                        <height>105</height>
                        <width>140</width>
                        <url>http://www.abc.net.au/news/image/7388850-4x3-140x105.jpg</url>
                    </thumbnails>
                </contents>
            </mediaGroups>
            <title>New Zealand netball to get stronger after trans-Tasman split</title>
            <link>http://www.abc.net.au/news/2016-05-27/new-zealand-netball-to-get-stronger-after-trans-tasman-split/7454468</link>
            <author>Brittany Carter</author>
            <publishedDate>Thu, 26 May 2016 23:27:34 -0700</publishedDate>
            <contentSnippet>New Zealand's netball split with Australia has many fearing the worst, but it could well prove a massive boost for the sport ...</contentSnippet>
            <content>
                <p>New Zealand's netball split with Australia has many fearing the worst, but it could well prove a massive boost for the sport across the ditch.</p>
            </content>
            <categories>Netball</categories>
            <categories>Sport</categories>
        </entries>
I'd like to access the author, link and other elements at the bottom of the xml but have no idea how to. Here is my android code
try{
            //instantiate json parser
            JSONParser jsonParser = new JSONParser();
            //get json string from the url
            JSONObject jsonObject = jsonParser.getJSONFromURL(jsonURL);
 Log.d("JSONOUT",jsonObject.getJSONObject("responseData").getJSONObject("feed").getString("feedUrl"));
        }catch (JSONException e){
            e.printStackTrace();
        }
        return null;
My JSONParser class
public class JSONParser {
static InputStream is = null;
static JSONObject jsonObject = null;
static String json = "";
public JSONObject getJSONFromURL(String url){
    //start HTTP Request
    try{
        DefaultHttpClient defaultHttpClient = new DefaultHttpClient();
        HttpPost httpPost = new HttpPost(url);
        HttpResponse httpResponse = defaultHttpClient.execute(httpPost);
        HttpEntity httpEntity = httpResponse.getEntity();
        is = httpEntity.getContent();
    }catch (UnsupportedEncodingException e){
        e.printStackTrace();
    }catch (ClientProtocolException e){
        e.printStackTrace();
    }catch (IOException e){
        e.printStackTrace();
    }
    try{
        BufferedReader reader = new BufferedReader(new InputStreamReader(is, "iso-8859-1"), 8);
        StringBuilder sb = new StringBuilder();
        String line = null;
        while((line=reader.readLine())!=null){
            sb.append(line + "\n");
        }
        is.close();
        json = sb.toString();
        Log.d("JSONRECEIVE",json);
    }catch (UnsupportedEncodingException e){
        e.printStackTrace();
    }catch (IOException e){
        e.printStackTrace();
    }
    //parse received String to a JSON object
    try{
        jsonObject = new JSONObject(json);
    }catch (JSONException e){
        e.printStackTrace();
    }
    //return the completed string
    return jsonObject;
    }
}
 
     
    
HTTP method POST is not supported by this URL
Error 405
– JianYA May 27 '16 at 14:07