Call us on 1300 551 750 or Get a Free Quote

Adelaide web design, mobile development and identity design.

No, put away the strait jacket, we're not that kind of certified.

We've been working with Appcelerator's Titanium for almost a year now to rapidly build native iOS and Android applications using their javascript SDK.

There certainly have been challenges on the way. We're fluent with javascript, we use it with every project to perform ajax requests and to develop great user interface experiences. The biggest challenge wasn't developing with javascript or the Titanium SDK, but in building some kind of structure around our codebase.

When we develop server side web applications, Cloud and Code gravitates towards the CodeIgniter framework which uses the popular MVC design paradigm and allows separation of program, data and presentation logic. It allows a web developer to write neat, logical and re-usable code.

Jumping into Titanium however, after the basic tutorials such as adding elements to a window, installing and interacting with a database and so on, the structure of your application is largely up to you. In fact, you are officially referred to Titanium's own Kitchen Sink demo application for further source material and herein lies a big problem.

It turns out that the structure for this particular resource adopts an approach where the logic for each window is allocated to it's own individual file. Fine, you say, here we have the beginning of some kind of logical organisation to our codebase. And yet, it turns out that their method creates a new 'context' within the application, which can cause crashes and lead to memory leaks.

In other material they advise not to use this approach for your application. Seems it's a case of do as we say, not as we do.

We've noticed that this pitfall has caught a number of developers. Luckily, when Cloud and Code first began mobile development with Titanium we set some time aside to ensure that we didn't falter with our first steps.

We took the Mootools javascript framework that allows us to write modular, class based javascript and embedded it within our application. We then built base classes for elements, windows, database abstraction and so forth, to build our own little Titanium framework that helped manage memory and expedite development.

Now, we're happy to say, we've just completed our first Titanium SDK exam (our first exam in many years, don't miss those!) and we're officially a Titanium Certified App Developer!

Don't worry, we're at work so celebrations include bottled water and candy. We don't want to undo our good work by getting heady on champagne!

Comments

comments powered by Disqus