Hacker News new | ask | show | jobs
by trabianmatt 5231 days ago
I just released a native mobile banking app built using Titanium: http://itunes.apple.com/us/app/sf-fire-credit-union-mobile/i... and am happy to share my experiences with it.

The patterns and frameworks I use in single-page javascript apps carried over well to developing with Titanium, including tools such as Backbone and CommonJS. Titanium supports CommonJS directly now but it wasn't available when I started so I used Stitch to combine the code into a single javascript file and have been happy with the result. One bonus of using this approach is that I've been able to share a large portion of the code with the mobile web version of the app currently in development (using Backbone and jQuery Mobile).

While we ran into some problems that were difficult to track down, the code for Titanium is on GitHub and is easy to fork if you need to. For example, one thing that's prevented me from posting a link to this app previously is that the Android version (also built with Titanium) is experiencing frequent crashes on certain devices. After several (ok, 20+) hours of debugging I discovered that the problem was in the 'click' event handler on table rows -- the handler was passing the whole table row object in the event handler and was causing occasional crashes due to the size of that object. I didn't need that data to be passed in the events so I just commented out that portion of Titanium code and everything's great now (we're releasing an update shortly). Sure, it was a brutal bug to find, but the source was available and not too difficult to follow.

The app also includes custom modules written in Objective C for iOS and Java for Android, but only for very specific functionality that wasn't already included in Titanium -- 99% of what we needed was already available.

If there's any interest I'm thinking of extracting my pattern into a basic application that I can share with others and perhaps build a bit of a framework around it. Here's a gist as an example of code used in the app: https://gist.github.com/1832639

Edit: accidentally used a private gist.