Up at 5AM: The 5AM Solutions Blog

Mobile Development: Titanium Appcelerator for the Win

Posted on Thu, Apr 28, 2011 @ 01:25 PM

My last post discussed some options we considered when deciding the platform for developing a mobile product. I laid out the pros and cons of each option, but left off on a bit of a cliffhanger. The big reveal: we chose to use Appcelerator Titanium. We wanted to be able to have both iOS and Android versions of the product, yet we knew that we'd have to make to do with a small team that could not hope to maintain two separate native codebases. At the same time we really wanted an optimized, native mobile experience that we did not believe could yet be achieved with a mobile HTML5 application. Given these considerations, Titanium was really the only tool that fit the bill.

We've been getting up to speed and working with Titanium for a couple of months now. I wanted to share a few observations about our experience with the various components of the Titanium platform.

APIs and Frameworks

Titanium has done a very good job of defining APIs to expose the native platform capabilities in a natural way in Javascript. UI elements, network, local database, hardware capabilities - it's all there.

The one thing to note is that the APIs are fairly low-level. For example, there are APIs to create and manage UI elements like table views, spinners and tab groups, but there is no MVC or component framework built-in. Likewise the local database support is low-level, with no Core Data-type ORM capabilities. Some third-party frameworks are starting to crop up to provide these (e.g. helium and joli), but these are still in a rudimentary state.

Develop-Deploy-Test cycle

The Titanium application (and the new Titanium Studio, more on which later) provides for one-click building and executing your application in the simulator or on the device, both for iOS and Android. The process is quite fast - a first time build/deploy/run-in-simulator cycle takes on the order of 10-15 seconds for our app at this point, while subsequent cycles take 2-3 seconds. While out of the box Titanium does not support live code changes, there are some third-party frameworks that claim to enable it; however, with the 2-3 second cycle, we haven't needed it.

One caveat is that, although some syntactic errors in your Javascript files are caught at compile time, due to the dynamic nature of Javascript many errors (like referencing undefined variables) won't manifest until the relevant code is actually executed in the running application. This can be a bit jarring for someone used to Java. But here again, the fast turnaround time mitigates the ill effects, and overall the dynamic nature of Javascript is well suited to mobile development.

Tooling / IDE support

Initially, Titanium only came with an application for compiling your app and either running it in the simulator, deploying to device, or publishing to the app store. It was up to the developer to write the code using the editor of his/her choice. While you could use something like Eclipse or Aptana for doing this, there was no support for code-completion of the Titanium APIs, and, most acutely, no debugging support - it was back to the bad old days of debugging via log statements.

Fortunately this is set to change as Appcelerator released a developer preview of Titanium Studio, an Aptana Studio-based IDE that is the product of their purchase of Aptana a couple of months back. Titanium Studio includes a full Titanium-optimized environment, with code-completion of APIs, debugging, integrated log viewing, and one-click deployment. It also includes everything that Aptana Studio (and by extension Eclipse) does, and so can be a one-stop place to do server and client development. The developer preview is still pretty rough around the edges - I've had several problems with the debugger in particular - but i expect them to be smoothed out quickly.

Documentation

Titanium has good documentation, though not quite on the par of, say, Apple's developer documentation. The documentation is broad but not especially deep - almost all the properties, methods and events are documented, but it is not always clear how they play together. The best way to learn the framework is to browse the source code for the KitchenSink application, a kind of comprehensive showcase for the framework capabilities.

Conclusion

Overall it's been a very good experience, and while there are still some weak spots, they are rapidly being addressed by the Appcelerator team. We are excited to hone our skills as the platform matures, and use it to build a great product.

GET OUR BLOG IN YOUR INBOX

Diagnostic Tests on the Map of Biomedicine

MoBsmCover

Download the ebook based on our popular blog series. This free, 50+ page edition features updated, expanded posts and redesigned, easier-to-read maps. 

FREE Biobanking Ebook

Biobanking Free Ebook
Get this 29 page PDF document on how data science can be used to advance biorepositories.

 Free NGS Whitepaper

NGS White Paper for Molecular Diagnostics

Learn about the applications, opportunities and challenges in this updated free white paper. 

Recent Posts