0

as I'm new in developing Android apps, I'm here for some help about creating one for specific website. The task is to make app for news: there is supposed to be menu with categories like Business, Fun, Sport etc. with list of titles and pubDates for example (listView) and when you click on the item the whole news opens (title, date, images, content or similar).

Website has RSS with structure like this:

    <?xml version="1.0" encoding="utf-8"?><rss xmlns:a10="http://www.w3.org/2005/Atom"         version="2.0">
    <channel>

    <item>
    <guid isPermaLink="true">http://www.balkanmagazin.net/novosti-i-politika/cid128-57413/putin-i-kiril-cvrsto-zajedno</guid>
    <link>http://www.balkanmagazin.net/novosti-i-politika/cid128-57413/putin-i-kiril-cvrsto-zajedno</link>
    <category>Novosti i politika</category>
    <title>Putin i Kiril čvrsto zajedno</title>
    <description>&lt;img alt="" style=""  src="/Storage/Global/DynamicImage/cid-57413-        455-253-Kiril-Putin-ilu61cc0f32-1ea0-4049-9455-259d70fda69d.jpg" /&gt;
    &lt;p&gt;Važnije od ljudskih prava su vera, moral, svetinje i otadžbina, smatra Ruska pravoslavna crkva, ušančena u rovu odbrane Rusije od Zapada zajedno s Kremljom&lt;br/&gt;(foto: patrijarh Kiril i predsednik Putin)&lt;/p&gt;
    </description>
    <pubDate>Tue, 05 Feb 2013 01:12:12 +0100</pubDate>
    </item>

    ...
    </channel>

I'm asking are these tags enough to provide content and images from articles? Is there any way to get them from description or link tag or RSS feed has to have content tag for that?

Any help would be appreciated.

1

1 Answer 1

0

You want to familiarise yourself with a Sax Parser to read in the data.

A good tutorial I have personally used for Sax Parsing is here.

You will easily be able to extract the different fields from the Rss feed and add them to a custom object with Sax Parsing.

You can get hold of the link tag and you can set off a Http request to download the actual content of the URL, and then display it/parse it separately in a similar way. (HTML parsing can be tricker than RSS/XML, but still possible).

For extracting images etc from description, you are looking at a trickier solution, but you could for example search through the String you have extracted for the description and look for the "src=" tag, taking the text after that using String.subString() until you get to the end of the tag.

Hope this helps set you on your way.

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.