Flex/AIR on Devices: From Flash Builder to Android Ecosystems

This post is a part of my series “One Developer Platform, Many Devices“.

In this post, we will cover the workflow for delivering a solution from development in Flash Builder through packaging for various Android ecosystems.  In subsequent posts, this will be followed up with detail for delivering to each individual ecosystem.

You can start developing apps for Android using the debugging simulator built into Flash Builder. However, a critical step in your development process is that you must test and evaluate your applications on a physical device (preferably before you try to ship it).   Luckily for all of us, that is really easy with Flash Builder.

First, develop your mobile application.   When you are ready to test it on a device, simply go to the “Debug” menu and select “Debug Configurations”.

Debug Mobile Application

Next, create a new debug profile, select the platform “Google Android”, and select the “on device” debugging option with “debug via USB” selected.

Debug Configuration

Make sure that your test device(s) are plugged in via USB, and then hit the “Debug” button.   Using this approach, you can deploy to any Android device that has USB Debugging enabled.   This applies to phones and tablets… to enable USB debugging, you just need to go to Settings -> Applications -> Development, and then select the checkbox to enable USB debugging.    You can also use this method to debug on a Nook Color device, however you must have it unlocked already via your Nook developer account.

Once you have developed and debugged your application, you are ready to export it for real world consumption.    The first thing you need to do is specify you applicaiton name, version and id in your app.xml file.   Be sure that these are the final values, as the application id will be the unique identifier for your application in all marketplaces and if you distribute the APK manually.

Application XML Configuration

Once your application configuration is finalized, you will be ready to actually export the project.   Right-click on your project in the package explorer and go to the “Export…” option.  You can also perform the same action by going to the File -> Export menu.

Export Menu Options

Next, select the “Release Build” export option, and click “Next”.

Export Release Build

Set your export folder, and a base filename for the output file(s), be sure to select the target platform “Google Android”, and export as “Signed packages for each target platform”.   Click “Next” to setup your platform signing options.

Export Release Build Options

For Android, you can use a purchased signing certificate, or use a self-signed certificate.  Just use the browser button to locate your signing certificate, or click “Create” to crate a certificate.

Export Release Build - Platform Signing Options

If you create your own certificate, the following window will be displayed.  Just enter a publisher name (your name), a password, and a file location.  Next click “OK” and the certificate will be created and you will return to the Platform Signing Options screen.

Self Signed Certificate

Next, click “Finish” and your APK file will be generated.

Export Release Build - Platform Options

Now that you’ve generated your APK binary file, you are ready to push to the various app stores… Let’s take a look at this process for each ecosystem:

  1. Google Android Market
  2. Amazon App Store
  3. Barnes & Noble Nook App Store