Quite
after a long time come up with a post on one of the Current trend on
Mobile Application Development , Hybrid Mobile Applications.
“Hybrid”
applications are a special category of web applications that extend
the web-based application environment through their use of native
platform APIs available on a given device. The hybrid application
design pattern is equally applicable to both mobile and desktop
environments.
Hybrid
mobile apps are like any other apps you’ll find on your phone. They
install on your device. You can find them in app stores. With them,
you can play games, engage your friends through social media, take
photos, track your health, and much more.
How
are hybrid mobile apps built?
Hybrid
mobile applications are built in a similar manner as websites. Both
use a combination of technologies like HTML, CSS, and JavaScript.
However, instead of targeting a mobile browser, hybrid applications
target a Web-view hosted inside a native container. This enables them
to do things like access hardware capabilities of the mobile device.
These are capabilities that are often restricted to access from
inside mobile browsers.
What
are the motivations to go hybrid?
Hybrid
mobile applications provide a way for developers to re-use their
existing skills in web development. Developers don’t like the
prospect of getting locked into proprietary platforms. This includes
the programming languages and SDK's provided by platform vendors.
Hybrid mobile application development looks 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.
Yes, it’s true that hybrid mobile application development enables
developers to target more than one platform. However, each platform
comes with a set of caveats when it comes to its web run-time or
Web-view. This is especially true with Android, which is inconsistent
between OS versions. Moreover, there might be unique capabilities of
platforms to which a developer may wish to target. In those
instances, a combination of plugins and platform-specific code must
be utilized in order to take advantages of those capabilities.
When
should you build a hybrid mobile 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. For example:
Which
mobile platforms do you wish to target?
Do
you want to distribute your application via app stores?
Are
you looking to utilize the capabilities of the mobile device?
What
are the technical abilities of your development team?
Does
the one-size-fit-all approach of hybrid really live up to its
promise?
These
and other questions are worth asking before embarking upon
development of a mobile application. To elaborate on this, let’s
examine a few of these questions in more detail.
- WHICH
MOBILE PLATFORMS DO YOU WISH TO TARGET?
If
you wish 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 lends
itself well to this approach as well 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 then 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#.
- DO
YOU WANT TO DISTRIBUTE YOUR APPLICATION VIA APP STORES?
If
you want to distribute your application via an app store, you must
build a hybrid or native application. You cannot distribute websites
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 website
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?
Websites
have a restricted set of abilities as opposed to hybrid and native
applications. These restrictions are enforced by 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 alteratives. 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 slugglish. For that reason, developers have long-argued
against using hybrid as an approach 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. And it’s not just for game development. For developers
building more traditional, line-of-business applications, there are
frameworks like Famo.us and Kendo
UI.
- 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. You
can have a team that can target multiple platforms with a single set
of technologies. This is something worth considering when evaluating
your opinions.
Key Characteristics of
Hybrid Apps
Unlike web
applications or mobile websites, which the user can access by
browsing to the URL, hybrid apps are typically installed through an
app store and are available through the platform application
launcher. This means users have to follow the same procedure to
install hybrid application, as they would have for native
applications. The platform will ask users to grant device access
permission upon installation.
NOTE
There is a lot value
in developing platform-specific UIs, and you may eventually want to
do it once your application usage crosses a certain threshold. Having
said that, it should be relatively straightforward in the case of
hybrid applications using CSS.
Why Developing Hybrid
Apps Makes Sense
Hybrid apps have the
unique ability of reaping all the benefits of traditional web
applications without many of its limitations.
The benefits of
hybrid apps compared to native include:
Faster time to
market
-
Building a hybrid
application is typically faster and requires highly reusable
standards skills. It does not involve a tedious learning curve when
compared to native programming languages.
-
Inexpensive
cross-platform development cycle
-
Hybrid apps have
cross-platform compatibility, reducing the footprint of native code
needed, resulting in more reusable HTML5, CSS, and JavaScript that
can be shared and deployed across platforms with minimal adjustment.
This is primarily because WebKit is the platform of choice across
all major mobile phone OSes today. Cross-platform development cycles
also help keep the cost associated with development and testing
under control. The reusability of HTML code allows developers to
achieve a “develop once, deploy many” architecture. Native apps
on the other hand would require developers to perform full-feature
test rounds for platforms on which the application is being
developed.
-
Abundant human
resources
-
Hybrid apps are built
with web technologies, which means that there are many web
developers who have the base skill set to build mobile apps.
-
Cost of maintenance
-
Maintenance costs are
usually lower because one does not need to rewrite (port) all
application code to the native language of each device platform.
Further, since the skill set to develop hybrid apps is readily
available, scaling of a development team is also a nonissue.
-
Approval process
-
Most of the app stores
do have an approval process for which each app has to qualify before
it can be made available through the sales channels of that app
store. Because hybrid apps can be updated outside the bounds of an
app store, you can typically get away with one submission to the app
store. Once you are approved, you can push subsequent updates
independently through your server if you like. A key point to note
however, is that a fresh submission of the application would be
required every time you make changes in the native code associated
with the hybrid app.
-
Hybrid apps are the
future
-
Looking toward the
future and upcoming advancements in mobile OS technologies, one can
easily argue that hybrid apps are the future of development. Windows
Phone 8, Google announcements to eventually merge Chromium OS and
Android, Tizen OS, and Firefox all hint toward a hybrid future, not
too far away, and hence, building and deploying hybrid apps is
strategically a right thing to do.
The benefits of the
hybrid apps compared to mobile web include:
- Access to device
capabilities
-
As mentioned in the
introduction paragraph, hybrid apps offer the unique opportunity to
reap all the benefits of traditional web applications without many
of their limitations. Hybrid apps can extend the JavaScript
environment to access the native APIs and capabilities of the
platform that are not available through the generic web browser
environment otherwise, for example, true offline storage, as well as
access to contacts and other media on the device.
-
Unavailable new
platform features
-
Hybrid apps can take
advantage of the new features that are available in the new SDKs.
However, you will have to develop and expose that native layer using
plug-ins or a framework, which is usually the boilerplate code in
most cases.
-
Distribution through
app stores
-
Hybrid apps are
distributed through app stores just as native apps are. You
discover, download, and install them, as you would a native
application. Therefore as a developer, you can leverage an existing
well-established channel for content, app discovery, and
monetization.
-
Offline access and
execution
-
Hybrid apps, like
native apps, can be run locally on the device when the device is
offline—i.e., it is not connected to any network.
The possible drawbacks
of hybrid apps as compared to native apps include:
- Performance
-
You may experience
potential performance issues because JavaScript is fundamentally
single-threaded, which means that only one operation can be
performed at a time. However, if done right, you can come up with a
solution wherein you can offload background tasks to a native
thread, which would execute in parallel while your app is busy
performing UI operations. The native thread would then notify the
JavaScript of the events and task completions/failures.
-
Differences in
cross-platforms
-
WebKit is not equally
maintained in all mobile platforms, which means that there might be
indistinct differences between renderings and platform-specific
features to watch out for, though one could arguably say it is a
better scenario than rewriting all code from scratch. Further, this
is such a well-understood topic that often you would find material
describing ways to identify and mitigate these UI experience risks.
-
Unavailable advanced
features
-
There might be
advanced features that cannot always be easily implemented on the
hybrid layer—for example, OpenGL-based rendering—however, the
set of features is rapidly shrinking with companies like Microsoft,
Google, and Mozilla introducing a bunch of new standards aimed at
bridging this gap.
-
Inconsistent user
interfaces
-
Platform-specific UIs’
look and feel might be seriously difficult to mimic using HTML, CSS,
and JavaScript.
The possible drawbacks
to the hybrid apps compared to mobile web include:
Not accessible via
website
-
A user is required to
find your application in a native app store and cannot access it via
a traditional web browser unless you’ve made one available.