<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jappit.com &#187; rss</title>
	<atom:link href="http://www.jappit.com/blog/tag/rss/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jappit.com/blog</link>
	<description>Mobile blog by Alessandro La Rosa</description>
	<lastBuildDate>Wed, 23 Nov 2011 10:38:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Parsing RSS feeds with J2ME and KXML</title>
		<link>http://www.jappit.com/blog/2008/05/09/parsing-rss-feeds-with-j2me-and-kxml/</link>
		<comments>http://www.jappit.com/blog/2008/05/09/parsing-rss-feeds-with-j2me-and-kxml/#comments</comments>
		<pubDate>Fri, 09 May 2008 12:28:05 +0000</pubDate>
		<dc:creator>pit</dc:creator>
				<category><![CDATA[j2me]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[forumnokia]]></category>
		<category><![CDATA[kxml]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=33</guid>
		<description><![CDATA[Some days have passed since last J2ME tutorial, so here is a fresh new one! Today we&#8217;ll see how parsing a RSS feed with J2me is easy using KXML library, a fast and small XML pull parser, expecially suited for constrained environments like mobile devices. A live sample, parsing the RSS feed of this blog, [...]]]></description>
			<content:encoded><![CDATA[<p>Some days have passed since last J2ME tutorial, so here is a fresh new one!</p>
<p>Today we&#8217;ll see how parsing a RSS feed with J2me is easy using <a title="KXML library" href="http://kxml.sourceforge.net/" target="_blank">KXML </a>library, a fast and small XML pull parser, expecially suited for constrained environments like mobile devices. A live sample, parsing the RSS feed of this blog, is available <a title="J2ME KXML RSS parser emulator" href="http://www.jappit.com/index.php?page=emulator&amp;midlet=kxml_rss_parser">here</a>.</p>
<p><img src="http://www.jappit.com/images/blog/uploads/j2me_kxml_rss_parser.png" alt="J2ME Kxml rss parser screenshot" width="231" height="175" /></p>
<p>The detailed explanation of source code is available on my Forum Nokia Wiki article: <a title="J2ME RSS Parser with KXml" href="http://wiki.forum.nokia.com/index.php/J2ME_RSS_Parser_with_KXml" target="_blank">J2ME RSS Parser with KXml</a>. If you&#8217;re interested only in plain source code, you can pick it up <a title="J2ME kxml rss parser source code" href="http://www.jappit.com/uploads/src/kxmlrssparser.zip">here</a> (it includes also the sample midlet you find on the emulator page). To use KXmlRssParser class, you must simply do:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">KXmlRssParser parser <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> KXmlRssParser<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003399;">Vector</span> rssItems <span style="color: #339933;">=</span> parser.<span style="color: #006633;">parse</span><span style="color: #009900;">&#40;</span>yourFeedURL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>and the parse() method will return the complete list of parsed Items, as instances of RssItem class. Source code is of course simplified, for the purpose of this tutorial, as it only considers title, link and description tags of each &lt;item&gt;, but once you understand KXml logic you can extend it, without much effort, to include other infos from RSS feed.</p>
<p>Other resources you might find useful:</p>
<ul>
<li>KXML JavaDocs: <a title="KXML JavaDocs" href="http://kxml.sourceforge.net/kxml2/javadoc/" target="_blank">http://kxml.sourceforge.net/kxml2/javadoc/</a></li>
<li>RSS 2.0 Specifications: <a title="RSS 2.0 specifications" href="http://cyber.law.harvard.edu/rss/rss.html" target="_blank">http://cyber.law.harvard.edu/rss/rss.html</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/05/09/parsing-rss-feeds-with-j2me-and-kxml/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

