Posts Tagged ‘web apps’

Keeping Web Apps Open

Monday, October 10th, 2011

by Ben Francis

The Universal App Platform

The best thing about web apps is that they can run on any platform. This is because they use a set of open standards which are universally supported. The latest incarnations of these standards like HTML5 and CSS3 are more powerful than ever and it seems inevitable to me that the web will eventually win out as the open, universal app platform.

The current generation of popular desktop operating systems like Windows 7, OS X and Linux and mobile operating systems like iOS, Android and Windows Phone treat web apps as second class citizens, inferior to their native platform-specific counterparts. But that’s all set to change.

Microsoft Windows 8, Google Chrome OS, The Linux Foundation’s Tizen and Mozilla B2G will all join Webian in putting web apps centre stage, as the preferred category of app on their respective platforms.

Fragmentation

Thanks to HTML5 and related standards web apps are already pretty powerful, but there is still some way to go before web apps can do everything that native apps can do. On mobile platforms new APIs are needed for access to telephony, messaging and cameras for example, and some kind of “app store” style distribution and installation mechanism is likely to be needed to provide a more app-like experience. “Installing” a web app is a little like bookmarking a web site and can provide an opportunity for the app to ask the user for all the permissions it needs up-front, download any resources which will be needed for offline use and perhaps add an shortcut icon to an app list.

Because there aren’t currently established standards for all of these features, each platform is intially rolling its own approach. Apps for Chrome OS can only be found via Google’s own “Chrome Web Store“, you have to have a Google Account to install them and many of the apps found there will only work in Chrome. Windows 8 will have a set of APIs for its new Metro user interface, but apps written for Metro won’t necessarily work on other platforms. We don’t yet know much about Tizen, but previous mobile platforms like HP’s WebOS and the MeeGo Web Runtime have also had platform-specific APIs.

An Open Approach

Mozilla is also working on a new set of web APIs, but in line with their mission of promoting openness on the web they’re doing so in a more open way. You can see the progress of their APIs for telephonymessaging (SMS), batteryvisibilitysettingspower management and contacts on Bugzilla. These new APIs on Mozilla’s core platform are the first step towards a new mobile OS from Mozilla called B2G or “Boot to Gecko”. B2G will have a highly customisable UI built entirely with web technologies and will allow for the installation of Open Web Apps, as proposed by Mozilla Labs. With Open Web Apps, anyone can run their own app store or directory and the aim is to create cross-platform installable web apps.

Mozilla is also collaborating with Google on “Web Activities” or “Web Intents” which could provide a standard mechanism for apps to call other apps for certain functions. This collaboration is a promising sign because Mozilla can not define standards on their own and will need to co-operate with other browser & OS vendors.

Towards Standards

There are already standardisation efforts in this area at the W3C such as the Device APIs Working Group and the Widget Packaging and XML Configuration recommendation, but W3C recommendations are not always in line with what the implementors (browser & OS vendors) are doing.

For example, W3C Widgets provide a mechanism for installing a “widget” locally on a device by packaging up all of its resources in a zip file, including an XML manifest file. The specification was used for widgets in the Opera browser but when the MeeGo Web Runtime tried to use it as a method of installing fully fledged web apps it didn’t work out very well.

Mozilla and Google are taking a different approach to installable web apps, both choosing to use a JSON manifest file and rely to a large extent on HTML5′s offline capabilities for caching and updating offline resources. Even these two similar implementations have subtle differences which make them incompatible with each other so there’s a real need for standardisation in this area if we’re to have cross-platform installable web apps.

Hosted vs. Packaged

One slightly odd trend in the standardisation of “web apps” is the tendency to focus on “packaging” apps rather than “hosting” them. This seems to be an attempt to emulate the way mobile and desktop apps currently work by bundling up all of the app’s resource in a “package” which is downloaded and installed locally. The whole package then needs to be updated every time any of the resources change. This seems odd to me because this isn’t the way the web usually works and it doesn’t seem very web-like at all.

The fact that an individual resource can be identified by a URI is what makes it a part of the web, so to package resources up in one big bundle to be downloaded and used locally seems to break the web paradigm and therefore these apps are not “web apps” in my view, just apps downloaded over the web. This is how W3C widgets work and it’s also how Chrome “packaged” apps work and seems to be the direction of the Wholesale Apps Community, the EU funded Webinos project and the Native Web Apps community on the W3C web site.

For an app to be part of the web, I think all of its resources (HTML, CSS, JavaScript, images etc.) must be identifiable by a URI. Resources which are needed when operating offline can be marked as such in an HTML5 cache manifest, which then also provides an automatic update mechanism when these resources are changed. This maintains one of the great characteristics of web apps which is their ability to be updated seamlessly with new features and bugfixes without the user having to manually upgrade to a new version. Mozilla Open Web Apps seem to work in this way, and so do Chrome’s “hosted” apps.

Conclusions

It seems that web apps will be the preferred category of apps for a whole new generation of operating systems, but in order for these web apps to remain cross-platform new open standards must be agreed upon for APIs which give web apps all the power of native apps.

A mechanism for the discovery, installation and updating of hosted installable web apps and a trust framework which allows for secure open distribution is also something which I think desperately needs standardisation if the vision of a universal open web app platform is to be realised.


© Webian 2010