PhoneGap vs Titanium Mobile, et al
by Jonathan Stark
Greg Bulmash of Lynnwood, WA posted a thoughtful review of my iPhone book on Amazon. In it, he raises a point that I hear often:
Thing is the multi-platform framework space is *exploding*. Besides Phonegap, you’ve got Appcelerator Titanium, Rhomobile (with Ruby), the Flash CS5 iPhone packager that Adobe has in private beta, and more. The folks at FlyCast are about to open a service that converts, packages, and submits your apps.
It is true that there are many other cross-platform mobile development options available – and for the record, I do refer to a few of the more popular ones in the book. The reason I support PhoneGap is that it’s the only cross-platform mobile development solution that allows you to write your apps with standard HTML, CSS, and JavaScript.
In other words, with PhoneGap, you write a normal web app and then drop it into native app wrappers for the various platforms. With all of the other cross-platform mobile options, you write code based on a proprietary framework that will only run as a native app.
For example, you can write a Titanium Mobile app using Appcelerator’s proprietary framework to create native apps. But Titanium Mobile won’t output your app in a way that will also run in a mobile browser.
Call me crazy, but I see the standards-based mobile web as the future of mobile computing. I don’t advocate cross-platform development approaches that conflict with this view.
Another thing to consider is the number of supported platforms. Titanium Mobile, for example, only supports iPhone and Android. As I write this, PhoneGap supports iPhone, Android, Palm, Symbian, Maemo, Windows Mobile, and Blackberry. And iPad and Windows Phone 7 are coming to PhoneGap soon.
If you have a big mobile project coming up, it would be a good idea to investigate your options. Ultimately, the best approach will depend on your target market and goals. My general advice to developers is that if you can build your app with standard HTML, CSS, and JavaScript, then you probably should.
Comments
I understand some of what you are saying, but I have been working with Titanium and PhoneGap a lot recently and I have used nothing but JavaScript and HTML. In the end I have settled on Titanium.
Yes I call a Titanium-specific API from my Titanium JS code, but that is really no different than learning any popular JS library/framework or PhoneGap-specific JS I need to call in PG’s case.
Also, don’t forget, you can mitigate some of this by hosting a WebView in your native app and then using libs like IUI, JQTouch etc to essentially do exactly what PhoneGap is doing but with options to break out of the WebView and do much richer interactions with the native capabilities of the device than are currently possible with PhoneGap. If you factor it appropriately, the majority of your code will be compiled down to native code.
When it comes to HTML/CSS-only mobile apps, savvy users can tell the difference, no matter how fancy we try and get with the WebKit CSS extensions in mobile Safari/Android etc.
A huge amount of what I am building works fine in a browser and will scale it’s functionality based on the host (Browser or Native App).
The reality is HTML5 is still a ways away from abstracting us from all the details in really harnessing the power of these devices using only Web standards, so I think these hybrid approaches all have merit.
I think you are not really correct in calling PhoneGap and Titanium “different.” They are essentially the same, at the end of the day, in each platform I need to make JS calls specific to either, to leverage their power.
Wow, that was long :)
BTW, Mr. Stark, I love your book. Very clean, well-written and something that should be on every Web Developer’s shelf if they are considering expanding into the mobile realm.
Shaun Sullivan
(disclosure – I work for Appcelerator, the company behind Titanium Mobile)
To confirm what Shaun said, Titanium apps can absolutely be written using only HTML, CSS, and JavaScript without any native UI if that’s what the developer chooses. Also, I think Shaun made the point well about the UI advantages of a native application.
You can get Phonegap to run on more platforms – this is true. Titanium supports iPhone and Android today, but, we’ll be rolling out iPad support this week, and we now have devs hard at work on Blackberry support which we expect to add in the coming months.
Your final point is well taken – your project goals ultimately dictate your technology choices. The mobile web is great and is really advancing quickly – there are some incredible mobile web sites out there. I’d say, though, if you’ve decided you’re building a native app, you should really build a native app. Native apps perform fast and feel responsive to the touch, use platform-specific UI conventions, and have access to the latest device features. Titanium allows you to build these actual native apps in JavaScript, which we think is pretty cool. And since the core of your app runs across multiple platforms, it’s easy to create a great Android version, a great iPad version, and soon a great Blackberry version.
And I’m not sure what’s ‘proprietary’ about Titanium – the whole shebang is free and open source under the apache 2.0 license (github.com/appcelerator).
Titanium is a great idea for mobile app development (in terms of providing an easy way to leverage native mobile components via a JS API). The main reason that I stopped using it was because automated testing was very difficult to accomplish. The JS API is not backed by a actual calls to JavaScript, rather the JS API calls are parsed at compile-time and forwarded to native components at runtime. Since there is no real titanium.js skeleton or real JS implementation, it is not possible to mock-out the framework for purposes of automated and isolated unit tests (or BDD specs). All testing must be done manually which is just not a good approach to software development. The Phonegap framework actually does have a JS implementation script so it is possible to write automated tests that mock-out the framework. This is why I prefer Phonegap to Titanium, though if the Appcelerator folks provided a JS skeleton, I would likely go back to it.
I tend to agree with Jonathon. Phonegap is a genuine HTML5 solution to the cross platform problem, whilst Titanium uses javascript to map to a set of API’s the hold no relevance outside of Titanium. That being said, Titanium creates a more genuine native application, and for that reason when it achieves Blackberry support it will be much better than Phonegap’s (Blackberry has a weak browser). Android and iPhone however both have excellent browsers and I’m sure Phonegap provides and excellent solution on those platforms.
You must be logged in to post a comment.