Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use a XMLPullParser to get the data from your rss feed.</p> <p><a href="http://developer.android.com/training/basics/network-ops/xml.html" rel="nofollow">http://developer.android.com/training/basics/network-ops/xml.html</a></p> <pre><code> URL url = new URL("http://feeds.hindustantimes.com/HT-IndiaSectionPage-Topstories "); XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); factory.setNamespaceAware(false); XmlPullParser xpp = factory.newPullParser(); xpp.setInput(url.openConnection().getInputStream(), "UTF_8"); //xpp.setInput(getInputStream(url), "UTF-8"); boolean insideItem = false; // Returns the type of current event: START_TAG, END_TAG, etc.. int eventType = xpp.getEventType(); while (eventType != XmlPullParser.END_DOCUMENT) { if (eventType == XmlPullParser.START_TAG) { if (xpp.getName().equalsIgnoreCase("item")) { insideItem = true; } else if (xpp.getName().equalsIgnoreCase("title")) { if (insideItem) Log.i("hi",(xpp.nextText())); } else if (xpp.getName().equalsIgnoreCase("link")) { if (insideItem) Log.i("hi",(xpp.nextText())); } else if (xpp.getName().equalsIgnoreCase("url")) { if (insideItem) { Log.i("hi",(xpp.nextText())); }//extract the link of article } }else if(eventType==XmlPullParser.END_TAG &amp;&amp; xpp.getName().equalsIgnoreCase("item")){ insideItem=false; } eventType = xpp.next(); //move to next element } } catch (MalformedURLException e) { e.printStackTrace(); } catch (XmlPullParserException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload