To install an AIR application via a server, on the Android device select Settings→Applications→Unknown Sources on the Android device.
Your server MIME type needs to be edited. The MIME media type for .apk is application/vnd.android/package-archive.
Upload the APK package to your web server. Open the native web browser on the device and enter the package URL. The device will download and install the application automatically. This may be useful if you want to make the application available to several members of a development team for testing purposes.
Developing AIR for Android is not limited to the tools mentioned so far. You can use a range of other products, but you need to manually install the SDKs and use the command line tool. Please refer to the links provided for more information on how to use them.
The Android SDK is used to install the application on the device.
The AIR 2.6 SDK is used to package and deploy AIR applications for Android. For more information, go to http://www.adobe.com/products/air/sdk/.
In all of the following development environments, you need to “overlay” the AIR SDK. Links are provided for instructions:
- The free Flex and AIR SDK uses the Flex amxmlc compiler and AIR command-line tools. See http://opensource.adobe.com/wiki/display/site/Home.
- Power Flasher sells FDT, a development environment for ActionScript 3 andMXML, and offers the open source SOSmax, a socket output utility for debugging. See http://fdt.powerflasher.com/docs/Community_Resources#Multiscreen:_Targeting_Mobile_Devices.
- Flash Develop is an open source code editor for Windows. See http://www.flashdevelop.org/community/viewtopic.php?f=9&t=8079&p=37453&hilit=AIR#p37453.
- JetBrains sells IntelliJ IDEA, a cross-platform editor particularly favored by Java developers. See http://www.jetbrains.com/idea/whatsnew/index.html.
When you use a tool other than Flash Professional or Flash Builder, you need to manually create the application descriptor. It is not generated automatically, and it must be packaged along with your application. Here is the code for creating the application descriptor:
<?xml version=”1.0″ encoding=”utf-8″ standalone=”no”?>
You need a code-signing certificate. If you do not have one, you can create a self-signed certificate with the AIR ADT -certificate command. The instructions are available online at http://help.adobe.com/en_US/air/build/WS5b3ccc516d4fbf351e63e3d118666ade46-7f74.html.
To package the AIR application as an APK file, run the AIR Developer Tool (ADT) from the command line:
AIR-sdk-path/bin/adt -package -target apk -storetype pkcs12-keystore yourCertificate.p12 first.apk Main-app.xml first.swf
To install it on the device, use the Android ADB tool:
android-sdk-path/tools/adb install first.apk
If the application is already on your device, use the -r command (for reinstall):
android-sdk-path/tools/adb install -r first.apk
Congratulations, you have just created and tested your first application. You can expand on it and make it more dynamic by requesting the user to enter a phone number. To do so, provide an input text field, or create a custom-designed numeric UI.