Mobile Development: Native Vs. Web

Posted by Optimation Editor on 31 January 2012

Having recently completed some research for a whitepaper on mobile development, in particular looking at options for a code once, deploy to many framework, I thought it might be timely to put down some on the insights that this research has lead to, in particular the growing debate around "native" mobile apps vs. HTML5 based web apps.

First lets set the scene...

With the smartphone market now firmly established as a genuine application platform, and the lack of single dominant platform, mobile app developers are being faced with the challenge of developing and maintaining apps across multiple platforms. Rather than up skilling in each individual platform for each mobile environment, many developers are turning to cross platform development frameworks, hoping these will assist with the utopian goal of code once, deploy to many.

As soon as you start looking at the various cross platform development frameworks currently available you begin to see these are generally based on one of two approaches:

  • A framework that allows you to code in a single language (e.g. Java, JavaScript, C++, C# etc) and then provides a blackbox that produces a native app based on the specific SDK for each supported mobile platform (e.g. iOS, Android etc).
  • A framework based on web technologies (primarily HTML5, CSS, and JavaScript) allowing you to build an app using standard web technologies with the framework providing access into the phone hardware (camera, location services, multimedia etc) as well as providing a wrapper so the web app can be accessed and used in the same manner as a normal "native" app (rather than having to open a browser and navigate to a website).

The key point here is that both of these approaches provide a developer with a means of creating an application without the need to re-code the application separately for every platform they wish to support.

When you start looking at the various options (and there are a multitude of genuine framework offerings now available - the scene is ripe for a period of consolidation and buyouts, a topic for a whole separate post maybe) the first decision you need to make is which of these two approaches you wish to use.

This decision will inevitably draw you into the debate as to which is best, "native" apps, or web apps.

The debate...

Web based apps have traditionally been the poor cousin on both mainstream PC platforms as well as in the mobile space. There have been many valid reasons for this, some of the key ones being:

  • Web apps are generally accessed by first opening you web browser, and then entering the necessary URL to get to the website where the web app is hosted.
  • The user interface capabilities available using web technologies has traditionally lagged well behind the capabilities of native desktop or mobile applications.
  • Web apps have traditionally not been available in an offline version, requiring the user to be online in order to access and use the web application.
  • Because web apps are rendered on the device through the browser, they are generally slower on the performance and responsiveness front.

With the rich and polished user experience Apple introduced with the iPhone, the second point above is most often pointed to as the key reason for developing a native code application, whether you are coding directly for that platform (e.g. Objective C on iOS), or whether you're looking at cross platforms development options enabling you to code once and deploy a "native" app to multiple mobile platforms.

However with the growing adoption of HTML5, and the increasing sophistication available in Javascript libraries, the gap between native apps and web apps has been significantly closed. This includes utilising HTML5 for offline storage in web apps, and the introduction of wrappers allowing the web app to be presented to the as a standalone app without the need to access via a web browser.

For the user experience, the use of HTML5, advanced JavaScript libraries such as Sencha Touch, and frameworks such as PhoneGap, all combine to provide a web app that looks and behaves very close to what can be achieved by native apps (i.e. developing in the native code for a given platform). Developers may be able to pick the differences, but they are subtle enough that an average user would not notice.

From a performance perspective, web apps still need to be rendered on the device, but the ever increasing processing power now available on smart phones has largely mitigated any performance concerns for all but the most complex mobile apps.

When taken from the context of wanting to make an app available on multiple platforms (e.g. iOS and Android), a web app has many advantages from an architectural perspective:

  1. Web technologies are inherently platform independent, they were designed from the very start as a stack of technologies able to be used in a consistent fashion across multiple platforms.
  2. Most cross platform development frameworks are designed to operate within a specific domain (e.g. mobile platforms, desktop OS's etc), however web technologies are common across all platforms allowing you to present your web app on smartphones, tablets, PC's etc.
  3. The growing acceptance of web technologies is permeating right through to the likes of Microsoft, who are incorporating web technologies such as HTML5 and JavaScript as core technologies for developing apps for the upcoming Windows 8 platform. Adobe has also taken a strong position on web technologies with their recent purchase of PhoneGap, which is likely to be used to fill the gap left by their discontinuation of Flash for mobile.

When all this is combined, we find that most of the commonly thrown up reasons for developing "native" rather than web apps are either non issues, or fast heading in that direction. Native apps will always provide some advantages due to the fact they are inherently "closer to the metal", but web technologies such as HTML5 and new JavaScript libraries will start to swing the pendulum in favour of looking at web apps as the first choice option.