A few days I was looking for some library to parsing RSS feeds in Java mainly for Android purpose. For me it was quite obvious that I will pick up library called ROME because of I have still a pretty good feeling about it from previous projects. Below you can find my piece of code which is very similar to this one on ROME website.
URL url = new URL("https://www.centralbank.ie/Pages/RSSFeedDisplay.aspx?FeedID=20"); SyndFeedInput input = new SyndFeedInput(); SyndFeed feed = input.build(new XmlReader(url)); List entries = feed.getEntries(); logger.info("Size : " + entries.size()); Iterator iterator = entries.iterator(); while (iterator.hasNext()) { SyndEntry entry = (SyndEntry) iterator.next(); logger.info("Entry : " + entry.getTitle() + " " + entry.getAuthor() + " " + entry.getLink()); }
If you will use official ROME library [1] on Android you will be faced with this error :
ERROR/AndroidRuntime(263): java.lang.NoClassDefFoundError: [Ljava.beans.PropertyDescriptor;
This error occurred due to lack of libraries on Android platform related to java.beans package. Fortunately there is a way to parse this RSS on Android platform properly. Only what you need to do is download fork of ROME library called AndroidROMEFeedReader [2] and apply jdom-1.1.1-android-fork.jar and android-rome-feed-reader-1.0.0.jar to your project in Android Studio. From this moment you will be able to fetch and parse RSS without including java.beans package to your project.
Reference: [1] ROME [2] GitHub AndroidROMEFeedReader [3] Docs Oracle Java Beans
Some time ago I have solved another technical test for one company. As the same before this test was performed for recruitment process.
This application is dedicated for tellers which provides functionalities like :
- Create account(s) - a user can create an account, associate a name with it, give it a unique account number, add a starting balance etc.
- Make lodgement - a user can lodge an amount into an account (balance increase)
- Make transfer - a user can transfer an amount from one account to another (balance transfer)
- View transactions - a user can view recent, or all, transactions for an account (statement)
- Spring Beans – 4.0.1.RELEASE
- Spring Tx – 4.0.1.RELEASE
- Spring Context – 4.0.1.RELEASE
- Spring Context Support – 4.0.1.RELEASE
- Spring Orm – 4.0.1.RELEASE
- Spring Jdbc – 4.0.1.RELEASE
- Spring Web – 4.0.1.RELEASE
- Spring Web MVC – 4.0.1.RELEASE
- Spring Test - 4.0.1.RELEASE
- Joda Money - 0.10.0
- Jackson Core - 2.5.0
- Jackson Databind - 2.5.0
- Jackson Annotations - 2.5.0
- Javax Servlet API – 3.1.0
- JSTL – 1.2
- Hibernate Core - 4.3.5.Final
- Hibernate Entitymanager - 4.3.5.Final
- HSQLDB - 2.3.3
- SLF4J - 1.7.8
- Commons Logging - 1.2
- JUnit - 4.10
- Mockito - 1.9.5
- Hamcrest - 1.3
- Twitter Bootstrap - 3.3.4
- DataTables - 1.10.7
- jqBootstrapValidation - 1.3.6
Home screen |
Create new account |
Deposit money |
Transfer money |
Transactions |
Application for tellers has also built-in Jetty web sever container which allows you run it very quickly using command mvn jetty:run in directory of project. After that application should be accessible under context http://localhost:9090/banknow/.
You can also build own WAR file using command mvn war:war in directory of project. War will be accessible under directory /target and called banknow.war.
Reference :
[1] GarciaPL Github.com BankNow
[2] Jetty
[3] HSQLDB
[4] jQuery DataTables
[5] jQuery jqBootstrapValidation