27 June 2011
Familiarity with building RIAs using Flash Builder.
Note: This is an updated and expanded version of an article originally written by Andrew Shorten.
Flash Builder 4.5 includes support for packaging Flex and ActionScript applications for Google Android, Apple iOS, and BlackBerry Tablet OS devices. The process for acquiring signing certificates and provisioning application packages for the various platforms differs significantly.
This article and video aim to help ActionScript and Flex developers complete the necessary steps so that applications built in Flash Builder can be deployed to Google Android devices during the development, testing, and deployment phases of the project.
For more information on packaging applications for other platforms please read the following articles:
Unlike developing for Apple iOS and BlackBerry Tablet OS, you can deploy applications to Google Android devices for testing and debugging purposes without signing the application package.
Connect the Google Android device to your computer's USB port.
On Windows you may also need to install a driver for the device; this may be supplied as part of the software package for your device or you can follow the steps outlined in the Flex documentation to install the Android USB device drivers.
To install and run the application on the device, you create a run configuration to run on a Google Android device.
To debug an application on a device, you use Flash Builder to create and install a debug APK package just as you did for running the application on a device. For debugging, though, your computer and the device must be on the same Wi-Fi network. The USB cable is used to install the application on the device; the Wi-Fi network is used for all communication between the device and Flash Builder when the application is running and being debugged.
In Flash Builder, select your Google Android device configuration profile from the drop-down menu for the Debug button and click Debug.
If you get a dialog box asking for the IP address of the host computer, enter it.
Flash Builder installs and launches the application on the device as before, but now when a breakpoint in the code is reached, the application will freeze and you can use Flash Builder to step through code exactly as when using the device emulator
If you have trouble debugging on the device, check to see if you computer is on a VPN or using a firewall. If the computer is on a VPN and the device is not, you may need to take the computer off the VPN for debugging to work. If you have a firewall turned on, try disabling it. If you cannot or do not want to disable it, try opening port 7935, the port used by the Flash Builder debugger to communicate with the device.
To create a release build of the application for distribution, you need to sign the application package when it is created with Flash Builder. The digital signature has two main purposes: to provide significant assurance to your users that you are a trusted signer whose code will not do anything malicious to their computers and that the application they are installing has not been accidentally or maliciously altered since it was packaged.
You can generate a self-signed certificate using Flash Builder or you can get a certificate from a certificate authority. When using a self-signed certificate, the application pubilsher will show up as UNKNOWN. Google does not require certificates issued by a certificate authority.
For development, it is quick and easy to just use Flash Builder to create a self-signed certificate.
You should sign all versions of the application (including updates) with the same certificate.
Before publishing your application, you will probably want to get a certificate from a certificate authority. You can get a security certificate from a trusted third-party vendor, a certificate authority, such as ChosenSecurity, GlobalSign, Thawte, or VeriSign.
For more detailed information on acquiring a trusted certificate, see the article Packaging Adobe AIR applications for the desktop.
When you have completed development and testing, you use the Export Release Build wizard in Flash Builder to create a release version of the application for publication on the Android Market.
Before using Flash Builder to create a release build of the application, set application properties and Google Android specific settings in the application descriptor file.
For Google Android applications, you should provide 36x36, 48x48, and 72x72-pixel PNG images, which are used for low-density, medium-density, and high-density screens, respectively.
When exporting for the Google Android platform, you must sign the application with either a self-signed certificate or a trusted certificate from a certificate authority. Google does not require certificates issued by a certificate authority.
In this article, you learned to use Flash Builder to run and debug Flex and ActionScript applications on Google Android devices. You also learned how to create a release build of your application for distribution. For more information, see the following resources:
Documentation: Developing Mobile Applications with Flex and Flash Builder
Documentation: Building Adobe AIR Applications
Documentation: Developing AIR applications for mobile devices