Click here to Skip to main content
13,193,048 members (61,267 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


7 bookmarked
Posted 19 Jul 2011

Flex 4.5 for Android: Getting Started with Flash Develop

, 19 Jul 2011
Rate this:
Please Sign up or sign in to vote.
Flex 4.5 for Android : Getting started with Flash Develop

Following on from my last post about getting up and running with Flex, here is how to quickly get an end to end Android dev environment up and running with Flash Develop.

You can download the complete Flash Develop project from here. But you will need to update the SDK paths.

Step 1: Install Flash Develop and the Latest Android and Flex 4.5 SDKs

Step 2: Create a New Flash Develop Project

Create a new Air Flex 4 Projector project and give it a name e.g. “MyFlexProject”.

Create a new flash develop project

Step 3: Enable the Project for Flex 4.5 Compilation

In FlashDevelop, go to Project -> Properties and under the “Output” tab, you will need to create a custom command to test your movie as follows: $(FlexSDK)\bin\adl.exe;application.xml bin. Replace $(FlexSDK) with the path to the flex 4.5 SDK that you downloaded.

Set the platform target

Under the “Compiler options” tab, set the “Custom path to flex sdk” property to your flex SDK bin directory that you downloaded earlier.

Add the following additional command line arguments:


Set the compiler options

Step 4: Create the application.xml File

Now we need to replace the application.xml with the latest supported version from the SDK. I always start with the Application.xml content that comes with the SDK to pick up any changes. In your flex 4.5 SDK directory under “Templates\Air”, copy the contents of the descriptor-template.xml and paste into your application.xml file.

Step 5: Setup the Package and Deployment .xml Files

Open the PackageApplication.xml and change the adt call to:

call adt -package -target apk-emulator %SIGNING_OPTIONS% %AIR_FILE% %APP_XML% %FILE_OR_DIR%

Change the signing options by removing the TSA option:

set SIGNING_OPTIONS=-storetype pkcs12 -keystore %CERTIFICATE%

Change the AIR_FILE variable to point to an apk file instead of a .air file, e.g.

set AIR_FILE=air/YourProjectName.apk

You will also need to update all the references to “$(FlexSDK)” to the path of your flex SDK. The same will need to be done for the CreateCertificate.bat file.

Step 6: Create an Android Deployment bat File

Just to make things a little easier, create a deployment bat file with a call to…

call adb install -r air\MyFlexProject.apk

Create a deployment bat file

Step 7: Test Your Project

Build the project to test the new settings. If everything has been setup correctly, your project should build successfully.

Step 8: Package for Android

Now let’s package the application for installation on an Android device.

Run your CreateCertificate.bat file and then run the PackageApplication.bat file. For the package to work, you will need to ensure you have valid values set in the application.xml file. If all goes well, you should find a .apk file in the air sub directory of your project working folder.

Step 9: Deploy to the Android Emulator

Run the Android SDK and AVD Manager which you will find in your start menu once you have installed the Android SDK.

Android AVD manager

Create an Android Device which must be running Android 2.2 and above to be able to run the Flex 4.5 Air runtime. Start up the Device.

Android device

Step 10: Test Your Application on the Device

Just to make sure the environment is running smoothly; go back to Flash develop and open the main.mxml file and add a panel with a simple label control. You will need to change the Root “WindowedApplication” tag to a “Application” tag. WindowedApplication is not supported by Android.

Create a simple panel

Now Build the project and run it. You should see your Panel and Label in the Air debug launcher.

Debug your application

Now Install your application onto the device using the PackageApplciation.bat file and then run the DeployToAndroid.bat file that you created earlier.

Deploy your application

You should now see your application appear in the Apps on the emulator.

Your application should now be installed

After running the application, it should look as it did when you ran it in debug mode.

The running application



This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


About the Author

Steve Psaltis
Software Developer
United Kingdom United Kingdom
We cannot achieve perfection but we can strive for excellence. Excellence through creativity that pushes innovation, collaboration that facilitates productivity, knowledge that empowers people and persistence that eventually pays off !

Enjoy what you do and do what you enjoy !

You may also be interested in...


Comments and Discussions

QuestioniOS equivalent? Pin
daluu14-Jan-12 20:28
memberdaluu14-Jan-12 20:28 
Thanks for article, will try it out sometime. Do you happen to have iOS type of tutorial?
"A good scientist is a person with original ideas. A good engineer is a person who makes a design that works with as few original ideas as possible." - Freeman Dyson

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.171017.2 | Last Updated 20 Jul 2011
Article Copyright 2011 by Steve Psaltis
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid