Native vs Hybrid App Development

Aldo Ziflaj

People enjoy using their smartphones because they can accomplish many things on the go such as reading e-mails, social networking, watching movies and plenty of other activities. We enjoy smartphones because they have many applications that make everyday activities easier.

If you are thinking of developing for the mobile application market, an important decision is to decide between developing a native application or a hybrid one.

It’s an age old question that refuses to go away, we thought it was time to revisit… Which is the best?

Native over Hybrid

Building native applications means using the native language of the platform, Objective-C on iOS, and Java on Android. The main advantage of native applications is their performance. Native apps are compiled into machine code (Dalvik byte code under Android), which gives the best performance you can get from the mobile phone.

Best performance includes fast and fluid animations as well as full access to phone hardware, multi touch support and the latest APIs.

Native development is far from easy. Despite the great number of resources that can be found, it may not be understandable to everyone. As code must be written specifically for each platform, the same code will have to largely be rewritten with little able to be shared. The logic may be the same, but the language, APIs and the development process is different. This process can be relatively long for complex applications.

Going Native

If you are new to mobile development and want to build performance-critical mobile apps and/or take advantage of native APIs, you would need a good resource on learning mobile native development.

Let’s take iOS for example. If you want to be a native iOS developer, firstly get yourself a Mac. You can write code anywhere, but a Mac is needed to build the code into an application as is an iOS Developer Account ($99 per year).

You can get a great intro to Objective-C by creating your own Flappy Bird game in your browser. A single online tutorial won’t quite do the trick though, Apple provides its own tutorial which is helpful for beginners and experienced developers. This tutorial introduces application design, structure and code implementation while building a ToDoList app (ToDo lists seem to be the ‘Hello, World!’ applications for mobile development).

As for Android development, I would recommend Learning Android, 2nd Edition by O’Reilly. It gives a good insight at of Android development while building a Twitter-like mobile client.

And of course, SitePoint has plenty of iOS and Android development articles for you to enjoy!

Hybrid over Native

Hybrid applications are web applications (or web pages) in the native browser, such as UIWebView in iOS and WebView in Android (not Safari or Chrome). Hybrid apps are developed using HTML, CSS and Javascript, and then wrapped in a native application using platforms like Cordova. This allows you to use any web-native framework you want, and there are plenty of these.

The application development is faster, simpler, more rapid and the application is easier to maintain. You can change platforms anytime you need, Cordova lets you build your application for more than one platform just by one adding line of code. As for the phone hardware such as the camera or Bluetooth, Cordova has a large repository of plugins you may use.

The main problem with hybrid apps is that they still depend on the native browser, which means they are not as fast as native apps.

Going Hybrid

If you decided to develop hybrid applications, then you should know that there are two main ‘competitors’ in this field. One is Cordova (and Cordova-based tools like PhoneGap) and the other is Appcelerator Titanium. They both target mobile platforms but work in very different ways.

Developing with Cordova is just like developing a webpage. You create HTML, CSS and JavaScript local files, test them in the browser and then wrap them in a native web view with Cordova (you’ll still need native SDKs and development tools for this step).

Using Titanium is a bit different, you don’t any HTML and CSS files, unless you want to create an application that uses both native and HTML-based User Interfaces. Titanium provides a very useful mobile tool set that helps you emulate (or simulate) your application on the real platform, not in the browser. When your app is run on the device, it doesn’t get wrapped into a web view, but gets interpreted by a Javascript engine (JavaScriptCore in iOS or Rhino in Android).

Appcelerator provides a good tutorial (surprisingly not a ToDo application).

There are also several other less known hybrid development options such as Xamarin, Rho, Corona and MoSync. All of these work in slightly different ways and may benefit you more depending on your current programming experience.

Conclusion

Both native and hybrid are ways to fulfill the different needs and preferences of users and developers, and none of them can be thought as a perfect solution. They have their strengths and weaknesses and it is up to you to decide which of them fits you better and which one you will use in your application.

What are your experiences and thoughts on Hybrid vs Native development?

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • http://www.isights.org/ Michael Long

    Actually, I don’t view Appcelerator applications to be “hybrid” apps. It’s really a cross-platform app development system that happens to use HTML, CSS, and JS for layout and development.

    The App store and iTunes store apps, however, are true hybrid apps. They’re native applications with HTML/CSS/JS content from the store delivered embedded in a web view.

    • Louie Avila

      I had to read your comment a few times. Apps submitted to the Apple store can be hybrid in nature. Sencha or JQuery made apps (targeted for mobile or desktop) compiled by Phonegap are hybrid.

  • http://retteras.no Anders Retterås

    I use Intel XDK which lets you build using Cordova or AppMobi services without having to install the SDKs for Android/iOS/windows.
    Intel XDK is a node.js application which works brilliant!
    -Avoid the AppMobi services, though. They are very poorly supported…

    • Aleksander Koko

      Hi Andreas Rettaras. Happy to hear that you are using Intel XDK. Actually I’m writing a series of articles about Intel XDK here on sitepoint. After a few days we will publish 3 parts about Intel XDK.

      • http://www.i-visionblog.com s.shivasurya

        great! surely i will follow! i have been using it for a month while ! pls look up on the jquery conflict ! with intel xdk js ! however it can be solved! but i dont know how to solve it !

    • Aldo Ziflaj

      Hello Anders
      I have taken a fast look at Intel XDK but I’ve never tried it. Actually, I’m waiting for the tutorial series that @aleksanderkoko:disqus is writing, and then I will try it :)

    • http://retteras.no Anders Retterås

      Looking forward to the article series on the XDK:)

    • YNWA

      But I would still need to pay Apple the $99/year fee to publish an app, right?

      • Vasi

        If you find a way to avoid Apple charges just make me a sign, I don’t know why but I feel like you’ll never answer me back.

    • http://www.i-visionblog.com s.shivasurya

      yeah they have very poorly supported forum and help :( ! but it is very productive ! with many options , themes!

  • YNWA

    I think it comes down to the size of your development team. For a small team with a long list of features that need to be added to the desktop and mobile version of a software application, it is better to use hybrid.

    I think without a dedicated team building native apps in tandem with the desktop version of the software it can be very hard to achieve the development goals you need to meet.

    Personally we have made a jQuery Mobile version for use in the browser and I will be looking into submitting them to the app stores after testing using Cordova or Phonegap. For now most users are on the desktop with the mobile version as a supplement. Thankfully our client base are those in the 40+ age range so we are not hopelessly behind in the mobile department.

  • Aldo Ziflaj

    Correct me if I’m wrong, but is that C++ code base ?

    • Aleksander Koko

      Yes. It’s a C++ code base. I was surprised too when I first checked. It looks like you got your way to develop true native mobile and desktop apps @AldoZiflaj . @SamFirouz, we are working with the mobile staff here on sitepoint to make a serie for that tool, so feel free to contact me for any future updates on this topic. It looks very promising and I like the idea on creating native apps on each platform. It’s like Xamarin is doing it for some time.