Posts

Showing posts from April, 2012

Experience in Building Mobile Application

I’ve finally completed my maiden HTML5 mobile application but have only managed to target it for Android. You may download it from getjar . Fundamentally, I’ve created the application due to a need to manage multiple library-loan accounts within the family. It is a hassle to check the accounts one-by-one for (near-) outstanding loans. My experience in development follows: What type of application should I build? Criteria Native App HTML5 App Mobile Website Learning Curve high medium low Performance good reasonable reasonable Device feature accessibility all most few Connectivity tolerance non-connected occasional mostly connected Server requirement NA NA Yes Quirkiness Low High Medium Marketability (on app-store) Yes Yes No Portability Low Medium High Basic Requirements Apache Cordova (PhoneGap) 1.5 jQuery 1.6.4 jQuery Mobile 1.0.1 Gotchas! I wanted to structure the directories into /js, /css. The easiest way is to move all the

How to embed images in a HTML page without ActiveX

We have this requirement to ensure that the saved (X)HTML is completely self-contained. This means that displayed images need to be embedded. Ideally, no additional plugin (e.g. ActiveX, Applet, Flash, etc.) is required. Therefore, instead of using a img tag with the src attribute that refers to an remote image, the src attribute could actually embed the entire image that is encoded using Base64. The magic is to use the data URI scheme . E.g. <img src=" data:image/png;base64 , <Base 64 encoded data> "> This is supported in Gecko-based (Firefox) and WebKit-based (Android, Safari, Chrome) browsers. Trident-based (IE 8 and 9) are also supported.

Java Class Loading Error/ Exception

Have you encountered some class loading/ definition issues in Java recently? To expedite troubleshooting such issues, you need to be aware of the 3 main Java errors/ exceptions and to be able to differentiate amongst them. They are: java.lang.ClassNotFoundException java.lang.NoClassDefFoundError java.lang.UnsupportedClassVersionError ClassNotFoundException Happens when a class cannot be loaded at runtime . This offending class is usually not known a priori This is often caused by the class loader not being able to dynamically load a required class. Examples of such offending class loaders are Class.forName() Classloader.findSystemClass() Classloader.loadClass() An IoC container (e.g. Spring) The exception is thrown with the class that is not found. E.g.  java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver To resolve this, check the class against the classpath. The situation would be a lot more complicated when multiple class loaders come into play (E.g. when