Getting Started With Appcelerator
Join the DZone community and get the full member experience.
Join For FreeWhen I started out development for mobile devices I wanted to get straight to programming for the iPhone. And as a Java programmer, Objective-C was going to prove to be an obstacle, even if temporary. I could have gone straight to Android, but I couldn't just ignore the iPhone market for my apps, could I? The answer to my problems turned out to be quite simple: Appcelerator, which provides a JavaScript API for developing mobile applications.
When I heard of the company first, they provided solutions for RIA, but now they provide a killer solution for mobile application development. From one set of source you can write a mobile application that can be deployed to the iPhone or Android. (They also provide the possibility to deploy to the iPad, but that's another article.)
Getting started with Appcelerator is quite straightforward. Here are a few tips to get you going, and speed you up even more in getting mobile apps out there.
- First download Appcelerator Titanium
- If you want to develop for the iPhone, you'll need to install on Mac OSX. There's no getting around that fact. Appcelerator cross compiles to ObjectiveC and needs the iPhone Developer SDK and XCode to be installed on your machine to do this.
- If you're targetting Android for your apps, you'll need to install the Android SDK.
- Bookmark the Titanium Mobile SDK API page.
Once you've installed and signed up, you can start creating apps. Before you do, I'd recommend downloading the Appcelerator KitchenSink example from GitHub. This shows all of the functionality that Appcelerator provides and is a great reference.
When you create a project, you'll soon find that the Titanium application is just for managing your project - you can't actually edit the project from Titanium. When you create a project, the structure of an application is created in the specified location. To start with the real coding go to the Resources folder of your project. That's where everything happens.
In there "app.js" provides a starting point for your application. The default mobile project creates a simple application with two tabs.
When you've made your changes, you'll want to see how the application looks in a simulator. To compile, go to the Test & Package section of your project (as highlighted below), and using the Run Emulator tab, click on launch.
Any compile errors will be displayed in this window, halting the launch if necessary.
There's a lot more to Appcelerator that I'll be covering in the upcoming weeks - stay tuned!
Opinions expressed by DZone contributors are their own.
Comments