A mobile web app for all platforms

Mobile web vs Native apps by Josh Clark  #uxlx
Peter Svensson is a programmer at Greener Grass Web Design. Peter is also the organizer of the Android Only! conference that is taking place in Malmö 13-14 June.

Mobile apps are as hot today as websites were fifteen years ago. Everyone, and that means everyone, must have an app whether they need one or not. This has led to a huge increase in the need for app development expertise.

The cost of developing an app which is to run on several different platforms is high, however, as the development methods (and the languages) differ considerably.
What is interesting is that all modern mobile platforms apart from one (Windows Mobile) have long been using the same type of mobile browser, Webkit. This means that an application written inside a website in JavaScript, HTML and CSS, can be run with minor modifications on virtually all mobile platforms.

The modern mobile Webkit web browsers are also usually HTML5 compatible. They have access to a WebSQL database inside the browser and something called a “cache manifest”. Using WebSQL programs written in JavaScript can save data which can then be used when the internet is not available, something that is critical for a mobile application.

Cache manifest is a related function that allows the website where the program is located to describe which files are to be stored locally on the mobile phone. The files that are stored are usually pictures, HTML, CSS and JavaScript files, with everything else being downloaded from the server. When the mobile then loses its internet connection and the user wants to start or open the website, it still works because everything is automatically saved. Together with WebSQL this means that websites can work like real applications.

Advantages

So developing mobile web apps offers a number of advantages over developing each version of the application separately.

  • The development and maintenance costs will be radically lower.
  • The application can be updated easily by updating files on the server it was downloaded from.
  • You can bypass forced distribution (and any approval) via a specific app store
  • All or parts of the application can be used in an ordinary web browser

Disadvantages

Mobile web apps still have problems with some things, such as 3D graphics, file management, access to the address book, taking pictures, etc. However there are ways around this.

Appcelerator (a paid service) and Phonegap (free) are two development tools that let you write a web app in the way described above, while also having access to JavaScript APIs for the accelerometer, address book, camera and much more.

When the web app is then compiled for one (or all) of the available mobile platforms, a “native” app for that platform is created, enabling you to have your cake and eat it too.

Comment
Perspektiv