HTML5 vs. PhoneGap vs. Xamarin vs. Native

Posted on 2/24/2014 @ 2:29 PM in #Non Techie by | Feedback | 51335 views

This is a question I get hit by at least twice a week. We have more than 4 years of mobile apps experience in the enterprise space. Do hit us on the contact link.
Since I get this question quite a bit, I’m putting together my thoughts on this topic, so I can point anyone who asks me this question rather than repeat the whole story. :-)

There is no perfect world. Each approach, HTML5, HTML5 packaged (icenium, phonegap), Xamarin, Native have their advantages and disadvantages. It is up to each organization to decide the level of quality and control they desire, versus the money and time they are willing to spend towards it.

First HTML5:

  1. No app store nonsense, no approval processes, apps update instantly.
  2. With the exception of push notifications, all native capabilities are more or less available on most devices. But some are not as good as native.
  3. One codebase can serve many platforms, as long as you do responsive design. This means you save on development costs – big time!
  4. The final product is never perfect – you can’t get the native like smoothness in HTML5.
  5. You do have to account for platform specific issues. jQuery Mobile standard UI looks pretty stupid on iOS7, and Windows Metro UI is completely different. One site to fit them all, is a bit of a tall order. Not that it can’t be done, but its tough.
  6. HTML5 really has no concept of per app VPN etc. The whole device is online on your network or nothing is.
  7. HTML5 is the easiest for corporate IT departments to manage. A large percentage of business apps work fine on HTML5.

Next, PhoneGap/Icenium – a.k.a. write in HTML5, but package in a native shell:

  1. Compared to HTML5, you have to go through App store approvals. Apple has been known to reject such apps, it’s a hit or miss sometimes. What will pass is a bit of a black science.
  2. You can tap into native capabilities better than HTML 5.
  3. You can work with MDM solutions, and per app VPN etc.
  4. But your server side API becomes more complex
  5. And you will frequently find yourself extending the shell your HTML5 app is packaged in – which means you are doing some native development.
  6. The App will feel heavier compared to native, but you cannot ignore the cost advantages. This is one step up from HTML5 in both cost and quality.
  7. Harder for IT departments to manage, not impossible but most IT departments are grappling with the steep learning curve. Unfortunately many are too cool for school and are trying to solve Mobile with a Windows Desktop like mentality :)

Xamarin:

  1. Native, no cheating – this is native. But there is an overhead, it isn’t like ObjectiveC native. The apps are going to be larger – this minor stuff matters when you are trying to get the max oomph out of your very resource restrictive mobile device.
  2. You still need a mac :-)
  3. A huge emphasis on better app patterns like MVC or MVVM, because user interface is still native. You can write about 70% reusable code using Xamarin, but the last 30% or more depending upon your app design and nature, has to be native.
  4. Hey you just bought into Xamarin. Some companies don’t like that, they’d rather deal with Microsoft or Apple or Google. I don’t have an issue with Xamarin, but some larger clients do.
  5. Your dev. life gets pretty complicated, and you need an experienced Xamarin expert to guide you through structuring your product code nicely, or you will see steam come out of your ears and your devs self combust over time.
  6. Generally speaking, in my experience, I’ve had better luck finding support and code samples for native, than for Xamarin. This is balanced with the fact that I am working in Visual Studio and C#.
  7. And like I said, you still need to know ObjectiveC and Java – even if you are using Xamarin.
  8. Perhaps the biggest advantage of Xamarin – you can use C# and Visual Studio for a large percentage of your app. And visual studio is hands down the best Dev IDE.
  9. And Visual Studio + Xamarin = $$$$$. Plus a Xamarin developed product, while superior than HTML5 and Packaged HTML5, is going to cost you more. You have to evaluate if your needs justify the cost.
  10. Have to go through AppStores, will work with MDM, can tap into native capabilities.
  11. Harder for IT departments to manage, not impossible but most IT departments are grappling with the steep learning curve. Unfortunately many are too cool for school and are trying to solve Mobile with a Windows Desktop like mentality :)

Native:

  1. On Mac – the IDE is free, and to publish it costs $99/yr ($399 for enterprise). Android, free mostly. Microsoft – will cost you an arm and leg and your first born’s blood. Yeah I know they have express versions, but most dev shops won’t use them. Long story short, if you are targeting Mac, you can afford to have your dev sit for 2 months or more, and learn XCode – for the licensing cost you will pay the xamarin route. It’s a big cost. And that $99/year – yeah you’ll spend that with Xamarin too.
  2. Best support for iOS is going to be on ObjectiveC and XCode. Same goes for Microsoft and Android. Once you get good at Xcode and ObjectiveC, you can beat the pants off of xamarin or html5 or etc. But at the end of the day, you are stuck with an App that works really nicely, on ONE platform. That is a downer.
  3. If you wish to write for Mac/iPhone/iPad – XCode has a decent amount of code-reusability. If you wish to support WinRT, WinPro, WinPhone, Microsoft has lesser than XCode but still decent code-reusability. But if you wish to reuse between Windows and Mac – forget about it. You can of course abstract a lot of it in a services layer, but then you are writing a connected app or an occasionally connected app which are complex to write.
  4. The final product is sweet! Hands down it is better than all the above options.
  5. Have to go through AppStores, will work with MDM, can tap into native capabilities.
  6. Harder for IT departments to manage, not impossible but most IT departments are grappling with the steep learning curve. Unfortunately many are too cool for school and are trying to solve Mobile with a Windows Desktop like mentality :)

 

So you see – there is no perfect world. I hope I ended up confusing you even further. But one thing is for certain, you cannot discount any of the above options in making your decision. Neither picture is perfect. 
And given that mobile is where all the growth is, you cannot be not serious about mobile. So assuming that you will end up getting serious about Mobile, my suggestion is to go with a strategy that is half HTML5 (start here), and some native (where you need it).
Even when you go with pure HTML5, there is a LOT to consider when it comes to security, and structuring your apps properly.

Hope this helps (or confuses).

Sound off but keep it civil:

Older comments..