I want to make an app which (amongst other things) can parse feeds loaded via the network. Given that the standard Android + Core Java libraries do not provide a feed parser service and I don't want to write a one myself, can you nominate a Java feed parser which will work on a low-spec Android device.
I'm just starting out learning Android, having completed the Hello World examples I'd like to move onto my first app. I want to make something which parses some ATOM or RSS feeds and displays some content in a GridView.
The UI stuff seems to be very well documented in Android, and Sun have plenty of examples of how to retrieve a URL, however I'm not so how to do the feed parsing.
Previously when I've done this sort of thing in Pythion I use a general purpose feed parser which can parse pretty much anything (e.g. RSS, ATOM). There are plenty of good Python implementations of this sort of thing, however I've not found anything like this as part of the standard Android library.
At work I've done (light) maintenance on corporate java apps. The general practice seems to be to take whatever classes you like (e.g. the Jakarta Commons feed-parser) and simply bundle them into the CLASSPATH. Desktop apps do not care how big the dependancies are, however I'm sure that's a big issue when compiling an APK bundle for use on a device with limited meory. Surely I have to be very picky about what kind of Jars I depend on, right? Can I just go ahead and use the same classes that I'd use for desktop apps?
Notes:
What is Parse? Parse is an open-source Android SDK and back-end solution that enables developers to build mobile apps with shared data quickly and without writing any back-end code or custom APIs. Parse is a Node.
Universal Feed Parser is a Python module for downloading and parsing syndicated feeds. It can handle RSS 0.90, Netscape RSS 0.91, Userland RSS 0.91, RSS 0.92, RSS 0.93, RSS 0.94, RSS 1.0, RSS 2.0, Atom 0.3, Atom 1.0, and CDF feeds.
Rome appears to be one of the most popular java RSS libraries. I guess it can be used on Android too.
Since RSS/Atom feeds are essentially XML documents you can use SAXParser, which is part of the standard Java libraries included with Android.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With