Thursday, June 11, 2009

Did you mention you wanted a mobile version?

Today I worked on the mobile version of my Orbeon Forms application. I had to go through some trial and error but I was once again amazed at how quickly I managed to get something significant out there.

Essentially, my current webapp is laid out for a desktop monitor form factor. Having downloaded the latest WebKit mobile browser emulator for Win32, my tests showed that this little engine was right up there with the big guys in terms of JavaScript, CSS and XHTML support. This browser technology is available now on the Apple iPhone and very soon on Android, Palm Pre, Black Berry etc. Maybe more on this subject later but for the time being, I want to discuss how I got my application to be smartphone friendly in just a few hours. Sure, I still have some work to do but the basic foundation is there.

Essentially, I just had to create a handheld friendly version of my CSS and epilogue files. I also created a folder for the handset navigation. The page-flow.xml file in this folder refers to oxf:/config/handheld-epilogue.xpl instead of pointing to the standard epilogue.xpl program. Tweaking handheld-epilogue.xml was trivial. The harder part was tweaking the handheld friendly version of my CSS (thank God we can rely on Firebug for help). I also created and used a file to replace my theme.xsl which allowed me to remove the superfluous content from the interface and produce pages that make near optimal use of the small screens. In fact, I was able to reuse existing pages without any reengineering which is really the most rewarding aspect of the whole exercise.

I even had time to experiment with redirection of http requests based on user-agent sniffing. Pretty easy to do actually so now, if someone points a smartphone at my application, she gets automagically redirected to the handheld formatted content. Pretty cool don't you think? I must admit that the guys (and gals perhaps) at Orbeon are doing a tremendous job and that although Orbeon Forms may present a relatively steep learning curve up front, the dividends are there for the long haul.

So long,

No comments:

Post a Comment