Now that I have your attention, let’s talk about PhoneGap (I’m writing this post on the train to Boston and can already feel the torch mob forming at Back Bay).

Today I want to talk about the encroachment of the web onto mobile platforms. This will be of greatest interest to those who develop enterprise applications. I still have no reservations recommending the native approach to high-performance mobile apps, whether in complex visual delivery or something that requires a lot of processing before being shown to the user. Most enterprise mobile apps however are built for comfort, not for speed and this opens new and interesting possibilities for wrapper frameworks like PhoneGap.

Though all smartphone manufacturers are looking to “differentiate” themselves in the market, enterprise clients who want to enter the mobile realm want the exact opposite – to create a single app experience that would be able to span all of the platforms after a single development effort. They are willing to sacrifice some of the functionality that native development would give them, but enterprise apps tend not to use accelerometers, compass navigation, various other bells and whistles; the loss is not felt nearly as much as the gain of being able to reach your audience on many platforms. The mainstream framework used to achieve this is PhoneGap – a wrapper for HTML5/Javascript code that allows it to form the application view and access the native APIs (the access is limited on some smartphones and pretty broad on others) of the mobile platform.

Full stop. It’s at this point that I would like to focus your attention on the HTML5/Javascript part and not so much on the wrapper part. If I understand the original premise of PhoneGap correctly, the decision to use HTML5/Javascript was made primarily because of the large web application developer base that had no way of doing mobile development and PhoneGap was supposed to open the floodgates to them. Yet the bigger value of PhoneGap is its ability to bring dynamics of the web onto the mobile platform. Rather than having a static app with static and functionality submitted to the app store, as it happens with native development, you should think of PhoneGap as a portal for accepting code that may have morphed and evolved outside of the smartphone while you weren’t looking at the app.

Dynamic Page Loading

This first trick is called dynamic page loading. HTML5 is HTML5 and Javascript is Javascript, so there’s nothing that should stop us from downloading fresh HTML5/Javascript code from a web service and displaying it to the user once they start the app on their phone anew. This somewhat screws with the concept of vetting the app before submitting it to the app store, but it opens a lot of possibilities for the enterprise client who would like to be able to time changes in their mobile apps with marketing campaigns, release bug updates without the user noticing and in general experiment more freely with the user’s experience without having to go through the resubmission process.

There are safeguards in place that prevent you from doing anything malicious and there are constraints on when you can load executable Javascript code, but in essence your application is no longer limited to what the developers had written during the initial submission process. There are interesting scenarios that are now possible, when the entire applications morphs to the user’s preferences, depending on how they were using the application. This morphing can also be based on individual and group machine learning, since the web service responsible for serving the code to be loaded on a mobile device can act as the central point for collecting data from multiple devices.

Existing Analytic Tools

The second trick is to remember that since you’re dealing with HTML5/Javascript, you can reuse web frameworks that have existed since the dawn of time. If you’re going to be using dynamic page loading for marketing purposes such as A/B Testing, you would be interested in the Google Analytics plugin for PhoneGap. Your clients’ marketing departments will love you, since they can now use the same interface for tracking users on more obscure mobile platforms using the same tools they use today for web analytics. Why reinvent an analytics suite to see what your users are doing on your app, if it’s already been done before?

Essentially what we are seeing is the web bringing its benefits and accumulated toolset to the mobile space, where the back-end service now has greater opportunity to enrich the user’s experience by providing more agile code to be run on mobile platforms.

We have to rethink what is a mobile app. It’s not really a static chunk of code anymore, specific to the platform that it runs on and with the same behavior every time the user runs it. If written with HTML5/Javascript, it can now evolve and morph more intelligently, to better service its users.

Now what would happen if every computing device ran HTML5/Javascript and could execute it after loading new code from the cloud?