by Ralph Eck | Dec 05, 2013
So far in this series we’ve discussed both HTML5 and Native as major frameworks for mobile application development. The debate still continues to generate more heat than light. But there is a third, and arguably more appealing, way known as Hybrid, which has gained considerable traction in recent years as the “best of both worlds” alternative between the HTML5 and Native conundrum. Let us take a closer look under the hood of Hybrid to see what it is and why it provides an interesting alternative to the other approaches.
Why Hybrid is Becoming the “new Native”
The third category of mobile application approaches is known as Hybrid. As its name implies, Hybrid is anything that is derived from disparate elements. And so by extension, in the world of mobile development a Hybrid app is one that represents a mixing of both web technologies and native device features. The first step to understanding how Hybrid works involves awareness of the native container environment. For example, iOS uses a web view control class called UIWebView to present HTML, CSS, or JavaScript content in the application. To initiate this, you simply create a UIWebView object, attach it to a window, and send it a request to load the index.html content on the iPhone through the native browser engine, WebKit.
What companies like Adobe’s PhoneGap have done to leverage this UIWebView feature more fully is to develop an abstraction layer comprised of a set of JavaScript APIs. These APIs allow mobile developers to access the hardware device functions like the camera or accelerometer through the use of a JavaScript call rather than relying exclusively on native code like Objective C (iOS) or Java (Android). One writer has described this all quite clearly as follows: “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.”
There are significant benefits of being able to access the Native APIs of a device through a common web language like JavaScript. Using a native wrapper platform like PhoneGap now means that a single JavaScript call can be made to the Native API, regardless of the platform the application is running on. Below is an example of what a call to the camera API would look like in JavaScript:
Takeaways for the Business Leader
An indication of the rapidly growing popularity of Hybrid apps came when Gartner announced earlier this year that Hybrid apps would comprise 50% of the mobile market by 2016. And it’s not hard to figure out why. Consider some of the major advantages of a Hybrid approach to app development:
In the preceding articles we have discussed the three most commonly discussed approaches to mobile application development. While there are pros and cons of each approach, if one had to vote a strong argument could be made why Hybrid provides the best overall solution. But we’ve also argued so far that this binary “one-size-fits-all” approach misses the mark. The decision process behind the development of a clear mobile strategy has to be clearly and carefully formulated. There is simply too much at stake to reduce an organization’s mobile strategy to one overarching framework, as many pundits have tried to do.
In the next article we intend to develop this subject further and describe why an “all of the above” approach offers the most complete mobile strategies framework for the digital market today.
Category: Articles | Tagged No Comments.
Web & Cloud
Monitoring