Skip to Navigation

What Titanium Appcelerator REALLY is and How it Works!

Titanium is a cross-platform JavaScript runtime and API framework used to do mobile development on iOS, Android, and, most recently, the mobile web, with possible future support for Blackberry and Windows. It is only similar to other popular frameworks such as Rhodes and PhoneGap in that they all attempt to offer a cross-platform approach using web technologies. That’s where the similarities end. When writing an app using Titanium framework, you are essentially writing a native application using JavaScript. The key word here is “native.”

If the applications you are writing are native, then how does Titanium work behind the scenes? The Titanium framework uses a unified JavaScript API, with platform-specific features and native performance combined. When using Titanium as a framework, you should understand two major concepts. First, core features in mobile development can have the same experience across platforms, and you can and should utilize code reuse. Second, with more platform-specific APIs, user Interfaces, and features, developers should use specific platform-targeted code. For this reason, it is not a “write once, run everywhere” approach. This allows Titanium to offer a great user experience by offering access to native UI and native features to achieve a higher level of performance than most “hybrid” approaches.

A Deeper Look

Titanium takes code written in JavaScript, combines this code with the Titanium API (which is in written in the targeted device’s native language), and evaluates your code at runtime with a JavaScript interpreter that runs on the device’s operating systems. When you launch your app, a JavaScript execution is created in the native code and the JavaScript is injected as an inline object paired with native objects within the runtime environment. The pairing is strictly one-to-one in a way such as running inline JavaScript within HTML. This allows the Titanium API to act as a bridge to expose direct access to the native experience, through actual native features and APIs.

Many misconceptions over the years have developed about Titanium, which can easily be debunked with a clear understanding about the framework. The major one is that Titanium does not use the web view component approach used with other JavaScript toolkits and PhoneGap. JavaScript written in Titanium framework is not cross-compiled into the respective native languages. The JavaScript code is evaluated at runtime. Titanium offers native UI controls and animations, instead of replicating this through CSS or JavaScript toolkits.

Strengths and Downsides

The strengths of Titanium are access to a wider and higher level of APIs, native UI, and device-specific features out of the box. Titanium offers the same UI interface and components that are available to both Android and iOS developers, which is not offered using any other hybrid approach. In other words to visual emulation via CSS, OpenGL, or Flash, you are using the platform’s backend UI controllers, behaviors, and animations, which offers the native experience that most users expect. You can also extend on these visual aspects and other core features by extending the Titanium API to fit the needs of your applications. Another major benefit is that Titanium offers an approach to developing native apps with knowledge of JavaScript, instead of having to learn platform-specific languages. Finally, once you have completed an application, Titanium offers an automated way to package and distribute your applications to the platform’s respective app stores through an IDE called Titanium Studio.

One of the major downsides of using Titanium as a framework is that it still doesn’t offer as wide of support as most hope for today. This is mainly due to the fact that Titanium API connects directly to the native platform, and taking up a new platform is a lot of work. For this reason, Titanium only supports the larger platforms in Android, iOS, and some level of mobile web browser support. Also, some user interface components do not perform as well as their native counterparts. The Titanium team stresses that they are committed to spending a great amount of time working on this issue. Titanium can never support all native APIs and device functionality, which continue to grow and develop on the native platforms per each new release and update to the native operating systems. Titanium strives to offer at least 90 percent of these APIs and native functionality on its supported platforms.

Once you have an understanding of the unique way that Titanium works as a platform, you can understand the power of what is being offered:

  • A solution to create mobile applications currently on Android or iOS without having to learn to program code individually for each respective platform.
  • A platform that is able to access native controls and device functionality directly and offers a better user experience by offering behavior and animations a user expects.
  • Most of all a free platform for mobile development offered under the GNU General Public License.

This framework, even with its drawbacks, is offering more than other competitors and will most likely be further adopted.

Jason Powell is a Titanium Certified Mobile and App Developer. 

Comments

Hello,I am building complex

Hello, I am building complex app with Titanium and I have some thoughts regarding this subject (I mostly agree with article but have to mention couple of things). I am happy with performances, v8 engine on Android really made the difference, hardware acceleration on device also. Good JS skills are required, Titanium is not fault for bad code people write. As for bugs, they are hard to find in complex application due to limited debugging tools. Most of the time, Java exception is thrown on Android and it takes a lot of skill and time to find and isolate the source of the bug. Also, if you are community member without subscription, forget about support. Bugs reported by community members are rarely fixed, no matter of their importance and how basic they can be. So, in my opinion, building complex apps with Titanium is possible, but with lot of pain. Unfortunately, a lot of basic things still does not work and if you’re not payed customer that can be frustrating fact. It is rare case that I tried using something in the API and that it just worked. Regards .. Saurabh Saxena

Finally! a good explanation

Jason, THANK YOU for a good explanation. There is so much confusion - with everybody using and ABusing word NATIVE that it's really easy to get lost and stick Titanium in the same corner as PhoneGap ( which is what I was doing in my mind). I was wondering if you could clarify: in your experience what's the performance hit using interpreted javascript code for an app ( like Titanium does) vs writing a whole app in Obj-C or Java for their respective platforms? I'm planning on writing an app for internal use in our warehouse and speed and ability to handle 100s of transactions per second RESPONSIVELY is more important than saving time developing an app by using a Titanium-like framework. At this point I'm just researching: my main contenders are Titanium, Rhodes (most of our internal apps are done in Ruby and RoR so it would be an easy fit) and just using Obj-C & Java ( we have users using both Androids and iPhones). Also did you have any experience with Rhodes? Thank you Nick

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.