Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Getting Started With Appcelerator

DZone's Guide to

Getting Started With Appcelerator

· Mobile Zone
Free Resource

Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.

When 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!

Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing - learn more in this white paper, brought to you in partnership with Sauce Labs.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}