In this tutorial, we will learn how to create AIR Application for Android mobile devices using Flash CS5.5. To complete this Flash tutorials, you will need to have Flash CS5.5, Android SDK and Android 2.3.3 platform tools as will see later.
- How to Create a Snake Game in Flash Using AS3
- Creating Reflection in Flash Using AS3
- Bitmap Data Manipulation in Flash ActionScript 3
- Creating and Controlling Flash Animation with XML
- How to Build a XML Driven Quiz Application in Flash
- Approach to Understand XML and Flash Workflow
The first step is to download the Android SDK from http://developer.android.com/sdk/index.html.Pick your platform (mine is Mac.) Place this SDK someplace on your machine. I like to keep everything in my libs folder, so I would have /Users/username/libs/android-sdk-mac_x86.
Now that you have the SDK in a place you like, go to the tools folder and open “Android”, then go to “available packages” and download Android 2.3.3.
The next step is creating a “virtual device”. Click “new” on the right hand side, and you will have to make something that looks like this, then click “create AVD”.
To start the emulator, just click the start button. It should look like this:
However, for AIR, we need one more step. Get the file Runtime.apk from flash CS 5.5.
Copy this file into the platform-tools and run the following command
./adb -e install -r Runtime.apk (make sure you do this while the emulator is running)
This will install AIR for use in the emulator. I must warn you the emulator is VERY SLOW.
Now that the Android emulator is set up, make a flash file using AIR for Android.
Now onto the Flash part. I just made a simple Hello World application, where it has a text field that says “Hello from Android” and an image of the Android icon.
Just like with any AIR application, you will need to set up the descriptor file in the tools for AIR for Android. The general one is basic, no changes needed. In the Developer section you will need a certificate. If you don’t have one, create one, it’s very easy. Just choose “create certificate” in your settings. Finally, in the permissions section, you need to have “Internet” checked.
To test the file on the emulator, go to Test Movie–> on device via usb. You could also just publish the file when you are setting up the certificate, just press publish. When you publish you are creating an .apk file which you can transfer to your phone.
Then on the Android Emulator you will see you flash application.
Also, you will see this on the phone. That is it! Happy Flashing
If you are already a Premium Member then just sign in and you can download source file for this tutorial.