Developing Multiple Mobile Platforms Using a Single Codebase

Many of the apps I develop here at DAI are business rules-centric. Once in a while I get to play with CSS stylesheets and fancy jQuery UI widgets, and it’s a blast. I’m pleased to say that a new project appeared on our docket that promises to offer a great opportunity to do front-end development like we’ve never done before.

Designed for use on various phone operating systems, we will be putting together some native mobile apps. For many of you in the industry, this must sound familiar.

The first and biggest question that we asked is,

 “How do we develop for Android, iPhone, and Windows Mobile OS using a single codebase?”

The result of some preliminary research showed that this question appears to already have many different answers, and in a variety of flavors, too. Architectures like PhoneGap, RhoMobile, Appcelerator, Marmalade, Corona, and Trigger.io spring from the Google search results.

Working at a company that focuses on the Microsoft stack, my spidey-senses tingled at Xamarin and Mono, both of which offer C#.NET development environments. The other major player in the cross-platform mobile development game is the Big Three of Web Development: HTML5, CSS, and JavaScript.

Boom! Headshot.

This triumvirate of client-side web technologies leads the pack for sheer volume of options, but the one that shone brightly was PhoneGap, now known as Apache Cordova. PhoneGap uses the universal platform-agnostic web stack, has a large community of developers, and boasts our very favorite price: Free.

We’ll be using jQuery Mobile on top of PhoneGap for its powerful widgets and sleek appearance. Also featured in our JavaScript library list is the KnockoutJs MVVM framework, which has robust and easy-to-use data binding.

I put together a proof-of-concept ticketing system for my team to see. I started with an Android Virtual Device in Eclipse Juno, and with some dummy data and a single index.html page, this blossomed forth:

tickets graphic

It’s pretty, it’s simple, and it’s exactly what we need. I can’t wait to get in there and do more.