Oct
10
2010

Starting with AIR on Android - how to set everything up?

This article is a step by step instruction illustrated with screenshots on how to set up Flash CS5 to create AIR applications on Android device. In my case I'm going to be using HTC Desire but procedure is similar for other Android 2.1 and 2.2 phones. Instructions are based on Lee Brimelow's video tutorial from gotoAndLearn http://www.gotoandlearn.com/play.php?id=123.


IMPORTANT UPDATE: This article is now outdated, in the meantine Adobe has released the new version of AIR, new plugins to CS5 and finally the new version of Flash Professional. I encourage you to read my new tutorial on how to create and publish one AIR project that works on Android and iOS devices. 
http://sierakowski.eu/list-of-tips/82-starting-with-air-for-android-and-ios-building-one-app-for-both-platforms.html

1. First things first - if you don't have Flash CS5 yet, download the trial version from Adobe (very obvious step :)).

2. Go to http://developer.android.com/sdk and download the Android SDK package for your platform. I'm going to be using package for Windows.

3. After unzipping it (I'm keeping it in my Flash projects root folder), run the "SDK Manager.exe" file to install SDK on your system. By the way, you need Java installed to use this application.

4. Close "Chose Packages to Install" window that pops up first, as we don't need anything from here to be installed. In "Android SDK and AVD Manager" window you should see "Android SDK Tools" in Installed Packages. In my case this is revision 7.

AndroidSDK_InstalledPackages

5. Windows users need to install also "USB Driver package" from Available Packages. You just need to select it and click "Install Selected" button:

AndroidSDK_USBDriver

6. If you are using Nexus One, Motorola or Samsung you can connect your phone to USB port and follow to step 7. I have HTC Desire and like all HTC phones it has HTC Sense installed. In order to synchronize it with your computer, you need to install HTC Sync application that will also install HTC Driver. It should be available as an exe file on memory card of your phone, so you can select "Mount a disk drive" when plugging it in to a computer and install it from there. Alternatively you can download it from here: http://www.htc.com/www/support.aspx.

HTCSense

Now every time when you plug your HTC to computer, you need to select "HTC Sync" option from available option on your phone. If everything is OK you should also see a notification "USB debugging connected".

SelectingHTCSync HTCDebugging

7. Go to the tools folder of your unzipped Android SDK folder and find adb.exe file. This application will tell you if your device is seen by a system. Run in from Command Prompt (console) by typing adb devices. Once service is running you should see your device listed:

adbdevices

8. Once you are happy that our device is listed in "adb devices", you can go ahead and install the AIR for Android from the Android Market:

AdobeAirAndroidMarket

Alternatively you can download AIR runtimes as an apk file from Adobe website and install it using adb install.

9. Next download Flash CS5 extension (.zxp file) for AIR 2.5 that also targets AIR for Android from here: http://labs.adobe.com/technologies/flashpro_extensionforair/. Once downloaded you can just double-click it to install it in Adobe Extension Manager CS5.

adobeExtensionManager

If this is done you should see new template on Flash CS5 welcome screen:

FlashCS5Screen

10. Now you may want to set up Flash to automatically install and launch your applications on your phone which is a real time saver. To do that select AIR for Android template from the Welcome screen, and then select one of the options available. There are cool templates like Accelerometer or Swipe  Gallery - they are great simple projects to get up to speed with basics of developing for Android. Once template is loaded, click on "AIR Android Settings" in "Document Properties Panel":

FlashCS5AIRAndroidSettings

Open Deployment Tab and in After publish section select browse to the adb.exe file which is placed in your AndroidSDK tools folder and select "Install application on the connected Android device" and "Launch application on the connected Android device".

FlashCS5AfterPublishSettings

11. When you also configure your certificate in Deployment tab, you are ready to test template application. If you click publish, you should see application automatically launch on your device and also it will be available in your apps listing on your device.

accelerometerApp AndroidAppIcon

Well done, you just installed your first Android app.

Obviously, this is not the way to sell your application, but only test when developing. You will want to place it in Android market and Lee Brimelow has done quick video tutorial on how to do that on his website: http://www.gotoandlearn.com/play.php?id=131

To take screenshots of your phone use another tool from AndroidSDK tools folder called Dalvik Debug Monitor. Launch it from ddms.bat. Then click your phone and select on"Screen Capture..." from Device menu.

Comments 

 
0 #9 enigman 2011-09-06 18:46
Quoting Carmen:
Hey,

great post! Can you please send me the " CS5 Extension for AIR 2.5"?
Can't find it at Adobe's website anymore. :(

Thanks in advanced!:)
Carmen


Google for flashpro_extens ionforair_p2_112210.zxp
Quote
 
 
0 #8 Carmen 2011-09-03 19:26
Hey,

great post! Can you please send me the " CS5 Extension for AIR 2.5"?
Can't find it at Adobe's website anymore. :(

Thanks in advanced!:)
Carmen
Quote
 
 
0 #7 aln 2011-02-23 19:00
Hi, i have the exact problem. I've installed the extension, have the drivers working .. when i load dalvik everything works fine

but .. as i try to publish with air to android i get same error as fguru .. error exporting swf file

can anyone help me with this?

maybe a link to the old extension (beta 1)?

alan
Quote
 
 
0 #6 sigman 2011-01-20 09:07
@fguru, what if you just try to publish an apk file with "After publishing" options unselected and then manually copy this file on your device and install? It seems that the issue is actually communication with your device. Have you installed USB Driver package from Android SDK? Does your phone prompt you whether you want to sync or just charge batteries when you plug it to your computer?
Quote
 
 
0 #5 fguru 2011-01-19 14:26
Sigman - thanks for your reply. I tried to publish in a regular way and it worked. It's wired to get an error, if I try to publish with Android setting popup.

I'm having one more issue here, I have Nexus S and when I test my device on adb devices Command Prompt it's not showing my device.
Quote
 
 
+1 #4 sigman 2011-01-18 22:11
@fguru - that usually happens when you have standard compiler error(s) in your project. In other words, have you tried to publish your project to regular swf and if so - does it work?
Quote
 
 
0 #3 fguru 2011-01-18 18:29
I tried these exact steps but for some reason I get the error = “Error exporting the SWF file. Please see the error(s) in the compiler errors panel” when I click on publish, and there are no errors in the compiler errors panel. Any ideas? Much appreciated.
Quote
 
 
+2 #2 sigman 2011-01-07 16:35
Adobe has updated their http://labs.adobe.com/technologies/flashpro_extensionforair/ extension and now there is no need to manually point to adb.exe anymore. Actually it seems that there is no need to manually install Android SDK yourself as all the necessary files are in your Program Files\Adobe\Ado be Flash CS5\Android\ folder including adb.exe!
So just plug your device and try to publish your application from AIR Android Settings panel.
Quote
 
 
0 #1 potatesalad 2011-01-07 01:44
I am running:
Vista 64bit OS
Nexus One device
Flash CS5
Air 2.5

I do not have the option to browse to my adb.exe in the Deployment tab > 'After Publish' section. ADB and the SDK are setup correctly. Does anyone know why that option would be missing? Thank you.
Quote
 

AS3 Tips

Follow me on Twitter