Appcelerator Titanium Studio – Mobile Development Made Easy?

I’ve been in the mobile development space for about 5 years and used quite a  few tools. I’ve heard about Appcelerator, but never given it a try. Finally the buzz is too loud to resist and I have a free day to fiddle around with it. Appcelerator Titanium Studio (ATS) is an Eclipse based development IDE. I’m using the very latest build as of July 4th 2012.

Why should I care?

So what makes this tool worth looking at with Pulsar, ADS, PhoneGap, etc.? Appcelerator claims a unified development environment across all platforms (desktop, web, mobile). They also claim to be a full featured IDE that can support all cycles of development, These are pretty big claims – in the Eclipse space I’ve yet to see a truly robust IDE for just one of these spaces let alone all four.

Installation and Getting Started

Download install…ok. First hiccup – the training links don’t wok on the main dashboard. Not a good sign, but I can work my way over to the website for some tutorials. There’s a good series of videos over there. Some labs are here – mostly the same as the videos. Creating a project is pretty simple using the supplied wizard.Titanium Studio IDE Fill out the fields and ATS will generate a skeleton project. I noticed a couple of things here. The most important is that you apparently cannot build iOS applications if you are using Windows – so the initial promise of the tool just evaporated.

The second problem is in the SDK setup – ATS is complaining: “The Desktop-SDK root path ‘C:\Users\beren\AppData\Roaming\Titanium\sdk\win32’ is not a directory”. I messed around with the settings and couldn’t seem to get this to go away. Well no worries I guess – the app does deploy to the simulator – use the little buttons above the app explorer. Kinda cool – but pretty darn easy in the basic android tools as well. The app does also App Deployed to Galaxy deploy to my phone and runs nicely! Not too shabby!

Next Steps – the kitchen Sink

The next step is to figure out how the APIs work and that means taking some steps thru sample code and the docs. There’s a bunch of samples on GitHub (Yes, further evidence that SVN is in a death spiral) so I would check there first with the constant caveat from the Appcelerator guys that these are not well designed apps, but crap thrown together as examples. Oh well – I’m going to play around with the kitchen sink example to see how the GUI widgets work and layouts are managed. This is always a pain in IDEs and is definitely not the strong point for cross-platform IDEs that I have used in the past.

After grabbing this project and remembering where the workspace for ATS ended up (under My Documents on Windows) – just copy over the files and import the project as usual with Eclipse tools and you should be good to go. Kitchen Sink is simply a laundry list of control widgets and APIs, not exactly a good model for programming, but its fun to play around with. Kitchensink deployed and works fine on my Samsung S running Android 4.0.4.

Looking at the code in KitchenSink starts to really make me wonder if this really is code once and deploy to all platforms – if you study code blocks like these:

app.js base_ui.js
if (Ti.Platform.osname != ‘android’)
{
indWin.add(actInd);// message
var message = Titanium.UI.createLabel({
text:’Loading’,
color:’#fff’,
width:’auto’,
height:’auto’,
font:{fontSize:20,fontWeight:’bold’},
bottom:20
});
indWin.add(message);
indWin.open();
} else {
actInd.message = “Loading”;
}
actInd.show();
if (Ti.Platform.name == “android”) {
win = Titanium.UI.createWindow({
url:e.rowData.test,
title:e.rowData.title
});
} else {
win = Titanium.UI.createWindow({
url:e.rowData.test,
title:e.rowData.title,
backgroundColor:’#fff’,
barColor:’#111′
});
}

you start to see that one code base is not really being used, but instead it is one merged set of code with a lot of logic to control the variations between platforms. Not necessarily bad and probably the only way to really do this, but not exactly the advertising and marketing pitch for the product. Both sections above are testing for platform you are on and then executing different blocks of code Layouts with Titaniumfor each. The software is riddled with this. There’s also quite a few blocks testing for other things like screen resolutions and such. Of course it is possible that I am simply not understanding the Titanium approach and goals – here is a great article that explains and certainly this is exactly what I see in the product. Very interesting.

 Architecture and UI Design

Many of the examples carry disclaimers like “don’t build your app like this”, so how do you build an app properly with this tool? There are two samples and a section of the docs to look at. The Geocode sample and the RSSReader sample offer the best examples at a structure – and try reading the main developer docs. To get the samples either download them from GitHub or in eclipse show the samples view and add them.

This is the place to look:

http://docs.appcelerator.com/titanium/2.1/index.html#!/guide/User_Interface_Fundamentals

Pretty good details on what is what and how it works. I’ll have to dig into this some more.

Verdict on ATS

Well – its not exactly what I thought it was, but so far its pretty cool and it does work. I’ll have to try an iOS device later to see if deployment works. I’ve used tools from Mobile Sorcery, Mobile Distillery, XCode, Blackberry, Pulsar, and some more. This looks interesting because it actually worked pretty easily, it does support at least a simplified model for building both an Android and iOS app, and it seems to have a decent set of APIs for access to specific phone features of the hardware. I’m going to play around some more with Bluetooth, USB data exchange, and perhaps a bit of things with NFC to see what I can do.

Leave a Reply