The Myth of Multi-Platform Mobile Development
If you’re a seasoned developer, the idea of cross-platform development has probably crossed your mind a few times already and well before the advent of mobile development. Java was welcomed and then abandoned as the language to write code once and run everywhere. At some point in the 1990′s, CASE tools became popular for letting you build the same app for multiple platforms. Frankly, web services and websites are the best attempt we ever made for building code that could be hosted on a variety of platforms.
The key point is: using a single framework to build applications for different platforms, only works if you are willing to accept certain compromises. Given the fragmentation in mobile at the hardware level, you can’t reasonably expect to pick a framework, write the same application once, and have it behave smoothly and as fast as a native application; on each platform and with a compelling device-specific user interface. In a way, it’s like the old game of picking two options out of three. Great user experience, excellent performance, and lots of programming goodies are available to you—but you’re only allowed to pick two.
Yet, developing mobile applications is neither cheap nor quick. It is commonly believed that outsourcing is preferable to in-house development, mainly because in-house development means that: first, you need to invest in training. It’s one thing to train a team of developers on ASP.NET and then have them build three sites in a row. It is quite another to train a team on three different mobile platforms and then have them build the same application three times from scratch—once for each relevant platform you plan to address. Outsource it. Whether you’re the software company or the buyer, how would you approach the development of applications for multiple mobile platforms?
Overall, there are two main approaches for cross-platform development:
• The Virtual Machine pattern is about writing the application using an abstraction layer that a platform-specific virtual machine will translate in the best possible way to the mechanics of the underlying platform.
• The Shell pattern is about hosting a web application in a shell of native code. In this regard, the use of HTML5 and its advanced capabilities (e.g., input forms, local storage, and offline behavior) is a winning factor.
As nearly every mobile API offers a component to view HTML, the idea behind the Shell approach is to integrate a web-view native component with the user interface of the application. The HTML to display in the web-view is usually bundled with the application but it may be downloaded from a remote site. PhoneGap is the most illustrious example of a framework that promotes the Shell pattern. In this case, the shell of native code has a fairly simple structure: it is a native window with a single web view. The web view displays a set of HTML pages (and associated files) embedded as resources in the application’s bundle.
In mobile, there are no silver bullets. Multi-platform development is often a business necessity and must be addressed. The solution comes in the context of a strategy rather than picking up some magical technologies. PhoneGap, Titanium and other frameworks are just some options to be evaluated in order to build the solution that works for you.