Over the past week, since we released the first beta of
For the purposes of this conversation, I’ll use the following definitions:
One of the most common concerns for web developers new to the mobile app world is the learning curve required to build native apps, or the lack of education on what a hybrid app is. My advice is, before committing down a single path, consider the user experience and what each option provides you. Native apps will always provide the fastest performance, at the cost of being more complex to code when compared to a hybrid app, while a hybrid app will be easier to build, using HTML5 and JavaScript, at the cost of giving up a little bit of speed. If the user experience you want to create is a Need for Speed style game, chances are you’ll want to use native technology to implement the app for each mobile platform you’re targeting in order to get the best graphics performance. If you want to build the next Foursquare, using geolocation and providing a means for displaying data and updating data, a hybrid app is a perfect solution and enables you to build it once, publish it through app stores, and have it work on several platforms.
Why might a business need a mobile app? Read 5 reasons given by our friends at Mobiversal.
Like any other technology choice, deciding between native and hybrid requires you to look at the user experience and decide on the level of investment you need to make to achieve the goal. Native apps will always require more investment because they are written with more complex languages,
Also, the approach to mobile app testing will differ for each type of app. Keep it in mind while planning the development process.
Hybrid, by
Hybrid apps use a web view control (UIWebView on iOS, WebView on Android and others) to present the HTML and JavaScript files in a full-screen format, using the native browser rendering engine (not the browser itself). WebKit is the browser rendering engine that is used on iOS, Android,
The real secret sauce of hybrid apps is the implementation of an abstraction layer that exposes the device capabilities (read: native APIs) to the hybrid app as a JavaScript API. This is something not possible with Mobile Web implementations because of the security boundary between the browser and the device APIs. Apache Cordova (formerly PhoneGap) is an example of a JavaScript abstraction layer over native APIs (for you Windows 8 folks, WinJS is another example of a JavaScript abstraction layer on top of native APIs). Through this abstraction layer a common set of APIs is exposed in JavaScript, and these JavaScript APIs work on any device supported by the framework (for WinJS that’s only Windows 8, but for Cordova that is seven mobile platforms including iOS, Android, Blackberry and Windows Phone 7). When the native wrapper is compiled around the HTML,
What this really means is that, for example if I build a mobile app with Apache Cordova, I can use JavaScript to access a native API, like the camera, using a single API call regardless of what platform the app will run on.
01.
navigator.camera.getPicture (
02.
onCameraSuccess,
03.
onCameraError,
04.
{
05.
quality: 50,
06.
destinationType: Camera.DestinationType.DATA_URL
07.
}
08.
);
09.
10.
function
onCameraSuccess (imageData) {
11.
var
image = document.getElementById(
'myImage'
);
12.
image.src =
"data:image/jpeg;base64,"
+ imageData;
13.
}
14.
15.
function
onCameraError (message) {
16.
alert(
'Failed because: '
+ message);
17.
}
Under the
Hybrid apps are a great option for you if you:
Hybrid apps are built with web technologies which means there are millions of web developers who already have the base skill set to build mobile apps.
Here is a graph that highlights the differences in native, hybrid and mobile web applications.
Icenium is no longer in Beta! How does it work? Learn more about Icenium and how it enables you develop hybrid mobile apps for iOS and Android with ease. Best of all, it's completely FREE until May 1, 2013!
March 2015 update: As with all things, a lot has changed after this original post. For an updated take, you may want to take a look at an article we posted on our Developer Network: What is a Hybrid Mobile App?
Jim Cowart is an architect, developer, open source author, and overall web/hybrid mobile development geek. He is an active speaker and writer, with a passion for elevating developer knowledge of patterns and helpful frameworks.