Book Image

Flash Development for Android Cookbook

By : Joseph Labrecque
Book Image

Flash Development for Android Cookbook

By: Joseph Labrecque

Overview of this book

Flash has now arrived to Android — the fastest growing smartphone platform. This offers massive opportunities for Flash developers who want to get into mobile development. At the same time, working on smartphones will introduce new challenges and issues that Flash developers may not be familiar with. The Flash Development for Android Cookbook enables Flash developers to branch out into Android mobile applications through a set of essential, easily demonstrable recipes. It takes you through the entire development workflow: from setting up a local development environment, to developing and testing your application, to compiling for distribution to the ever-growing Android Market. The Flash Development for Android Cookbook starts off with recipes that cover development environment configuration as well as mobile project creation and conversion. It then moves on to exciting topics such as the use of touch and gestures, responding to device movement in 3D space, working with multimedia, and handling application layout. Essential tasks such as tapping into native processes and manipulating the file system are also covered. We then move on to some cool advanced stuff such as Android-specific device permissions, application debugging and optimization techniques, and the packaging and distribution options available on the mobile Android platform. In a nutshell, this cookbook enables you to get quickly up to speed with mobile Android development using the Flash Platform in ways that are meaningful and immediately applicable to the rapidly growing area of mobile application development.
Table of Contents (18 chapters)
Flash Development for Android Cookbook
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface

Configuring the AIR SDK to package AIR for Android applications on Linux or Mac OS


If we are using the open source AIR SDK with another IDE or even editing our project in a simple text editor, we can still compile applications for distribution on Android through command line tools.

How to do it…

If you do not already have the Adobe AIR SDK, you must first download it from http://www.adobe.com/products/air/sdk/ and extract the files into a directory on your hard drive: /home/joseph/SDKs/AIR, for example. You must also set a PATH variable in your operating system start up script pointing to the bin directory underneath the AIR SDK.

We will set the environment variable through the following steps:

  1. 1. Open the Terminal.

  2. 2. Now we must create the shell configuration profile. Enter the following into the Terminal window: cat >> .bash_profile on a Mac or cat >> .bashrc for Ubuntu (each Linux distribution may have its own particular naming convention for the startup script).

  3. 3. Next, enter export PATH=$PATH:/home/joseph/SDKs/AIR/bin to set the PATH variable pointing to the AIR development tools bin directory. Hit Enter.

  4. 4. Enter Ctrl+Shift+D to end this process.

  5. 5. Now we will check to be sure everything was added appropriately. Type cat .bashrc into the Terminal and hit Enter. You should see the PATH command spit back at you:

  6. 6. You may need to log out of your profile and then log back in for the new environment variable to be picked up by the system.

  7. 7. Bring up the Terminal again, after logging back into your profile.

  8. 8. Type echo $PATH into the Terminal and hit Enter. This should display everything that is included in the PATH variable including the location of our AIR bin directory.

  9. 9. That should do it. We will now verify that we've set the AIR SDK up correctly. Type in adt -version and hit Enter. If all is well, ADT will spit back a version string that looks something like adt version "2.5.0.00000":

How it works…

Setting a PATH variable on the operating system allows us to be able to invoke the AIR Android compiler, ADT, from anywhere in our system without having to traverse file directories and specify long path names.

See also…

Note that you may have to log out of your session and then log back in for the new PATH variables to take effect. If using a Windows operating system, you can also set specific environment variables. See the previous recipe, Configuring the AIR SDK to package AIR for Android applications on Windows for an example of this.