boldr

iPhone app in 5 minutes with Titanium Mobile

Do you want to build native iPhone/Android apps with HTML/Javascript? And I mean real native not native but web like Rhodes and PhoneGap. If this is what you want you may give Titanium Mobile a try.

To convince you I have an example to show you. Let’s take a twitter viewer (how original it is!). To be simple, we will get the JSON from a search and create a table view with the 10 last tweets.

Bootstrap

After downloading and installing Titanium Mobile we create a mobile application. To test it with the iPhone XCode and the iPhone SDK must be installed. For Android, the Android SDK must be installed.

The first step is to edit the main view (index.html). We add all the JS we’ll need: jQuery and Underscore.js

Javascript

Titanium Mobile is a bit like Sproutcore. The biggest part of the code will be JS. To begin with it we need to get the tweets extracting text and profile image URLs:

Then we want a column layout with 2 things: text and image. So we apply the style for it:

And we initialize the table view:

Finally we show it in the current window:

26 lines of Javascript to create a twitter viewer! People who have already develop for iPhone will see how easier Titanium Mobile is.

Twitter Viewer with Titanium Mobile

There’s a lot of cool things like composite views, scrollable views, coverflow, maps, facebook connect… And it’s as easy as this example. If you don’t want to bother with a language you don’t know or/and you are tight on your schedule, Titanium Mobile is for you.

If you’re convinced and want to learn more about it the developers maintain a really useful example app.