Online Book Reader

Home Category

Developing Android Applications with Adobe AIR [9]

By Root 2514 0
Version 3.0 provides the ability to debug applications running on your device and send the output straight to an AIR desktop application. It lets you manipulate values, execute methods, and browse the display list. For more information, go to http://demonsterdebugger.com/.

Installing AIR on an Android Device via a Server

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.

Other Tools

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.

NOTE

The Android SDK provides great mobile tooling, which we will cover in Chapter 3. It is particularly valuable if you want to learn more about native processes while you are testing your application.

The Android SDK is used to install the application on the device. Refer to Chapter 3 for further instructions.

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 and MXML, 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:

first

first

1.0.0

first.swf

true

true

mobileDevice

]]>

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

Return Main Page Previous Page Next Page

®Online Book Reader