What is the most widely used feed-parsing library for Android
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?
- My background is in Python (with only light Java experience)
- Ideally I'd like to use something popular (not neccecarily the best) so I can get support on it.
- Even better, I'd like to use built in library functionality so I dont have to add any 3rd party Jars to bloat my app.
- Currently targeting Android 1.5 (because that's what my device runs)
Asked by: Sawyer622 | Posted: 25-01-2022
Rome appears to be one of the most popular java RSS libraries. I guess it can be used on Android too.Answered by: Emily923 | Posted: 26-02-2022
Since RSS/Atom feeds are essentially XML documents you can use SAXParser, which is part of the standard Java libraries included with Android.Answered by: Eric603 | Posted: 26-02-2022
It's fairly easy to setup an implementation of a SAX parser but the hard part is to be able to parse any and every feed under the sun.
You need to cater to all formats RSS 1, RSS 2, Atom etc. Even then you will have to contend with poorly formatted feeds.
I had faced similar problems in the past so decided to do my feed parsing on a server and just get the parsed contents. This allows me to run more complex libraries and parser which I can modify without pushing out updates for my app.
I have the following service running on AppEngine which allows for a much simpler XML / JSON parsing at your end. There is a fixed and simple structure to the response. You can use this for parsing
You can send both POST and GET requests with the following parameters.
feedLink : The URL of the RSS feed response : JSON or XML as the response format
For a POST request
curl --data-urlencode "feedLink=http://feeds.bbci.co.uk/news/world/rss.xml" --data-urlencode "response=json" http://evecal.appspot.com/feedParser
For GET request
My android app "NewsSpeak" uses this too.Answered by: Max453 | Posted: 26-02-2022
Check Lightweight Android library to read parts of RSS 2.0 feeds in https://github.com/ahorn/android-rss. I do not know whether is the most popular library for Android, but it looks fine to me. I have not tried it yet.Answered by: Daryl202 | Posted: 26-02-2022
There is also this new RSS library I wrote: https://github.com/Pkmmte/PkRSS
It's very lightweight, efficient, fast, customizable, and extremely easy to use. For example, the following code loads and parses your RSS feed in a background thread:
Easy, right? There are more details in the GitHub page for it.Answered by: Agata440 | Posted: 26-02-2022
Still can't find your answer? Check out these communities...
Android Google Support | Android Community | Android Community (Facebook) | Dev.io Android