May 31, 2012 Seth Perkins

Cross Platform Mobile Development : Titanium vs PhoneGap

Image representing Apple as depicted in CrunchBase   
The official online color is: #A4C639 . ???: ?...

 

 

 

 

 

 

 

 

 

 

 

At my company, a few months ago, we were in a situation to re-evaluate our cross-platform technologies.  We had been using a commercial version of PhoneGap and through much soul-searching and research, decided to make the jump to Titanium.  Thought I would take a few minutes and lay out my feelings on these two business app titans and what made us switch.

Strengths / Weaknesses.

PhoneGap

PhoneGap is HTML5 interpreted by the mobile device’s webkit.  If you can write webpages, you can write apps in PhoneGap.  If the target device can browse the web, it can probably run your PhoneGap app.

Strength.  Deployment Scale.

PhoneGap’s web-centric technology enables deployment across a plethora of hardware including iOS, Android, Blackberry, and Windows Mobile.

Weakness.  Lacking “native” hardware and API access.

Because PhoneGap rides on top of webkit, it only has access to webkit’s capabilities.  This has a few downsides.  First, native APIs are largely inaccessible (and rightfully so!  native access would break the deployment scale strength of PhoneGap!).  Because of this lack of access, native controls are not available.  For example, the “slot machine” spinner on iOS does not exist in PhoneGap.  It can be roughly emulated in some HTML5 equivalent.    Native eye-candy drawing effects are not available.  These all have to be mocked-up in HTML5 (JQuery).  The other downer, of course, to a lack of native access is performance.  No matter how you cut it, webpages are slow compared to a native application.  Doing a fade effect or a smooth swipe in on PhoneGap is painful.  It just doesn’t feel right.

Titanium.

Titanium is a custom API layered on top of the native API of a discrete set of hardware.  Currently, that hardware is limited to iOS, Android, and Blackberry (in beta).  The Titanium API is accessed through Javascript that is interpretted at execution time.  (No matter what you read elsewhere, Titanium DOES NOT create native code.  Read up on Mono if you’re interested in that.)

Strength.  Native Access!

Because the Titanium API is written on top of the native platform API, Javascript accessing Titanium is, in turn, accessing the native capabilities of the platform.  This is a HUGE boon for performance and visualization.  Titanium apps can look and feel native with the reaction time you desire.  The controls, effects, and power your users  expect is at your disposal.  Obviously, performance takes a hit being run-time interpretted vs compiled, but the difference is slight in a practical sense for most business apps.

Weakness.  Deployment Scale.

Because Titanium’s API is written on top of the native platform API, Titanium apps can only be built for platforms supported by the API.  This is currently iOS, Android, and Blackberry.

Which is better?

Neither.  What matters is : What do you want to do?

First off, cross platform development entails compromise.  DO NOT go into any cross-platform development expecting to write once and magically build anywhere.  You will be let down.  Manage your expectations and find a path that works for your needs.  In the end, you may discover native is really the choice for you.

If you are developing something that is really a webpage but in a mobile form-factor that you want to sell on the AppStore or Marketplace, or make available to the largest audience as possible with minimal customization, then PhoneGap is the choice.  Building for multiple platforms is relatively simple.  (check out PhoneGap’s site for demos).  Whereas, Titanium requires work to move from platform to platform: business logic can remain the same (a significant savings) but display work has to be tweaked per each platform.  That is simply the tradeoff for a native look-n-feel.

If you are developing something that is intended for a finite set of hardware (Droid and iOS) AND you require a user experience (UX) that feels native, then forget PhoneGap and start researching Titanium.  Titanium development is not as cross-platform as PhoneGap.  Any use of the word “native” implies customization for a platform, but the end result is something much truer to a native look-n-feel while minimizing rework between platforms.

If you are developing a game, DO NOT CONSIDER EITHER ROUTE!  There are development frameworks specifically for games.  Unity is my favorite.  It leverages several programming languages and builds NATIVE apps.  If this is your interest, check out http://www.unity.com

Hope this was helpful.

 

Related posts:

Tagged: , , , ,

Comments (2)

  1. Hi,

    Thanks for your post. We’re now jumping into choosing cross platform debate.
    – Our targets are iOS and Android only
    – We mainly display text and image, interact with RESTful services,
    – We need a speed of transition and effect like Flipboard to move between screens.
    – platform’s UI and UX is not really important because we will have our own styled-controls

    Do you feel the speed of Titanium output is enough for something similar to Flipboard? (swipe, fade, scroll)

    If not, we have to consider Corona/Lua programming.

    Many thanks.

    • Hi LockeVN,

      Put simply : I don’t know. I haven’t tried implementing Flipboard, but from what I’ve seen, I think Titanium is worth investigating and worth investing a few days to assemble proof-of-concept. Consider finding a Titanium expert on oDesk and see what they can do for a few hundred dollars. I’m sure the time you’re spending investigating is worth much more than the cost of putting together a quick POC.

      If you give it a go, do let me know how things progress.

      My Best and Goodluck!

Leave a Reply

Your email address will not be published. Required fields are marked *