How to build your first AIR4Android application using FDT and Eclipse

If you own an Android 2.2 (Froyo) device you must know that you can already start building (and testing!) your AIR 2.5 applications for Android. There’s more: if you are an FDT user like me you should be glad to know that is very easy to build and package our AIR4Android applications without even leaving our favorite tool!

Let’s start

I’m not going deep into how to setup your Eclipse environment with FDT as I assume you already have some sort of confidence with both of them. Let’s say you have a working copy of Eclipse and just installed FDT professional (or whatever version you like). Once you have these programs installed we can take care of SDKs.


Go to Android developer portal and download & install latest Android SDK for your platform. You can simply follow default installation instructions for this. In the same way download Flex 4.1 SDK and extract all content in a specific folder of your hard disk. At this point you just need to merge Flex SDK with AIR 2.5 SDK. The AIR 2.5 download is restricted to the Android Prerelease program members, you can sign up here. Finally configure FDT’s preferences to use the new Flex SDK location.

Please, refer to the official documentation to know how to setup your Android virtual devices and emulator if you want to debug your applications on the SDK emulator first… We will focus just on compiling the apk (Android installable) file we need to test the application on a real device.

The project

The project will be a simple, standard AIR project. The basic structure includes the app-xml descriptor, the main class file and icons we need for our application. Be sure to change your application descriptor namespace to include “2.5″:

[cce_xml]<application xmlns=”″>[/cce_xml]

and the “initialWindow” visible flag is set to true:




Now we have our project ready to be compiled and packaged. This should be the most boring part but I was able to quickly adapt a great ANT file shared from Jonathan Campos in a recent post.

Basically it consist in a total of three files;, and build.xml. The first two are just storing all path variables we’ll need to compile (SDKs, source files, assets location etc…), while build.xml takes care of compiling the swf, create a proper certificate, package the apk file for us and install on device too!

You just need to change to fit your setup:

[cce]# Flex SDK File Location on your computer
#Android SDK Folder on your computer

#App Settings

#compiler flags

CERT_ORG_UNIT=Software Development

That’s all! You can either run ANT file from command line of from Eclipse. Below you can see a picture showing how your project should look like:

Download and test!

I know, it’s a little boring to set up all this stuff before actually starting coding the good things. To solve this problem I uploaded a template project on google code for you to check out and use as base code for your next AIR Android killer app, enjoy:

Feel free to send me your comments and suggestions!

Related Links: (FDT) (Eclipse) (Android SDK) (Android prerelease program (Flex 4.1 SDK) (Original ant file)



2 Responses to “How to build your first AIR4Android application using FDT and Eclipse”
  1. Tonsula August 23, 2010
  2. AIR4Android December 31, 2010

Leave a Reply

Your email address will not be published.