Are Hybrid Mobile Apps Right for You?

By John Bristowe, Principal Developer Advocate, Progress.

Hybrid mobile apps are like any other apps on your phone; you can find them in app stores, and you can use them to play games, engage your friends through social media, take photos, track your health, and much more.

Although many similarities can be drawn, it can be very difficult to tell how a mobile application is built; trying to determine whether a mobile application is hybrid or native is like trying to differentiate rare grape varieties of wine. However, what matters is that the wine tastes good. A well-written hybrid app shouldn’t look or behave any differently than its native equivalent, and users don’t care which way the app is built, as long as it works just as well.

With all that said, many developers are left wondering about the benefits of going hybrid in today’s app-crazed world.

How Hybrid Mobile Apps Are Built

Hybrid mobile applications are built similarly to Web sites. Both use a combination of technologies such as HTML, CSS, and JavaScript. However, instead of targeting a mobile browser, hybrid applications target a WebView hosted inside a native container. This enables them to access device capabilities such as the accelerometer, camera, contacts, and more.

Today, most hybrid mobile applications leverage Apache Cordova, a platform that provides a consistent set of JavaScript APIs to access device capabilities through plug-ins that are built with native code. These plug-ins include APIs for accessing the device’s accelerometer, contacts, camera, and more. There are also a number of plug-ins that are built and maintained by the developer community at-large. These can be found in the Apache Cordova Plugins Registry.

Application assets like HTML, CSS, and JavaScript are packaged through the tooling made available through Apache Cordova to target platform SDKs. Once built, you have an application that can run like any other kind of application on the device.

Motivations to Go Hybrid

Hybrid mobile applications provide a way for developers to re-use their existing Web development skills. Generally, developers don’t like the prospect of getting locked into proprietary platforms. This includes the programming languages and SDKs provided by platform vendors.

Hybrid mobile application development tends to look appealing to an organization’s bottom line: Why hire a developer for each platform when you can hire one developer and target all of them through HTML, CSS, and JavaScript? Well, the reality is a bit more complicated.

Although it’s true that hybrid mobile application development enables developers to target more than one platform, each platform comes with a set of caveats when it comes to its Web runtime or WebView. This is especially true with Android, which is inconsistent between OS versions.

Moreover, there might be unique capabilities of certain platforms that a developer wants to target. In those instances, a combination of plug-ins and platform-specific code must be utilized to take advantage of those capabilities. Alternatively, developers can take advantage of third-party Web runtimes such as Crosswalk that can be embedded in your hybrid app.

Before committing to a platform strategy, it’s important to evaluate the technical and non-technical merits of hybrid versus alternatives like Web and native, especially as it relates to your mobile application’s requirements. To elaborate on this, let’s examine some questions worth asking yourself before embarking upon development of a mobile application:

Which Mobile Platforms Do You Want to Target?

If you want to target more than one platform, you have a number of choices. Clearly, the Web offers a highly attractive solution for this requirement. Your target is the mobile browser. Hybrid also lends itself well to this approach because of its reliance upon the WebView.

Native, on the other hand, finds itself in a unique space. If you are reliant upon the vendor SDKs and platform-specific programming languages, you are essentially coupled to the platform. In the case of iOS, it’s Objective-C or Swift; for Android, it’s Java; and for Windows Phone, it’s C#.

Where Will Your App Be Distributed?

If you prefer to distribute your application via an app store, you must build a hybrid or native application. You cannot distribute Web sites through app stores; that’s what your browser’s address bar is for! Despite this restriction, whether you build a hybrid or native application, it’s highly recommended that you have a Web site available for your mobile application. This will be the first place your users will expect to go if/when they encounter problems.

Are You Looking to Utilize the Capabilities of the Mobile Device?

Web sites have a restricted set of abilities as opposed to hybrid and native applications. These restrictions are enforced by the browser, effectively sandboxing it away from the mobile operating system. Recent developments with mobile browsers have exposed more device capabilities through HTML5 such as the camera, geolocation, and others.

Despite these advancements, support for advanced functionality is quite limited. For example, media capture and streaming remains unsupported in various mobile browsers. Because limitations like this remain in mobile browsers, many developers are compelled to evaluate hybrid and native as alternatives. Both offer the ability for developers to access device APIs; in the case of hybrid, this ability is supported through plug-ins.

It’s often asserted that native is best suited for applications where graphics performance is paramount. Mobile games are a class of mobile application almost entirely reliant upon complex visual interactions on the screen. Even if a game operates flawlessly from a functional perspective, you should expect it to have a very low app store rating if it feels sluggish. For that reason, developers have long-argued against using hybrid to build games.

That stated, a number of solutions for hybrid mobile applications exist. These include HTML5 Canvas and WebGL, both of which are well-suited for building applications like games. Furthermore, technologies like these are more approachable for developers through libraries like Paper.js, EaselJS, and others. For developers building more traditional, line-of-business applications, there are frameworks such as Famo.us.

What Are the Technical Abilities of Your Development Team?

Another factor to consider when evaluating your development options for mobile is your team’s technical abilities. If you decide to build a native application, you will require developers who are experienced with the platform SDKs and programming languages of every platform you wish to target. On the other hand, Web and hybrid applications are built using Web technologies like HTML, CSS, and JavaScript. Having a team that can target multiple platforms with a single set of technologies is definitely something worth considering when evaluating your opinions.

The Verdict

Even though there are many situations where building hybrid mobile apps is a perfect solution, it’s imperative to recognize that hybrid isn’t the be-all, end-all approach to mobile application development. If you find yourself developing an app that needs numerous native features, or an app where performance is critical to its success, you may find the hybrid development model limiting.

The important thing to remember about hybrid mobile application development is that it’s not a single approach; rather, it’s a spectrum of options ranging between Web and native. Determining if it’s the right fit for you requires evaluating the options and asking the right questions.

About the Author

Author head shot John Bristowe (@JohnBristowe) is a Principal Developer Advocate with Progress and lives in Australia. John is also an experienced speaker and frequently presents at developer conferences and events. Prior to joining Telerik, he was a Senior Developer Evangelist with Microsoft. You can find out more about John here.

More by Author

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Must Read