PhoneGap (created by Nitobi) was the first and notable framework that captured the attention of the mobile application development community and was eventually acquired by Adobe Systems.
Titanium (from Appcelerator), which was already providing tools for cross-platform application development for Desktops, started supporting iOS and Android around the same time as PhoneGap was announced.
Now, let’s see how PhoneGap and Titanium compare in cross-platform app development and when to choose one of these for your application needs.
PhoneGap / Cordova
PhoneGap is an open source project maintained by the Apache Software Foundation as Apache Cordova. Applications built using PhoneGap are a mix of native functionality combined with most of the business logic built in Javascript and the UI rendering in HTML5/CSS. PhoneGap does not have a UI library of its own, but provides an architecture for communication between the JS layer and the Native layer of the application. The Cordova development community contributes plugins that add to the base framework and modules of Cordova. Cordova’s aim is to build a sub-set of functionalities that are common to all the mobile platforms and expose them through the Javascript interface to a web application. This helps developers by eliminating the conditional programming (coding based on the underlying OS / platform) and focus on the app functionality. But this also causes developers to put in the extra effort and create their own plugins if they need any platform specific functionality.
Titanium
Titanium is also an open source project, which helps build native applications through a Javascript interface. Unlike PhoneGap, the UI of the app will be native but it is generated by Titanium after interpreting the Javascript code. Javascript being a well-known language and web developers being already accustomed to it, Titanium can help create native apps without much training. Developers still need to understand how native applications are created and how native controls or concepts are mapped to the Titanium SDK. Alloy is an MVC framework built on top of Titanium SDK, which uses XML and TSS file formats to define and style the UI of the app. Alloy uses Backbone.js and Underscore.js frameworks to provide tools and architecture needed for the MVC pattern in javascript.
Choosing the right toolchain
This blog does not intend to show one tool is better than the other, since there is never a “one shoe fits all” scenario. Your project requirements and priorities should help you choose the tool.