Managing the Android Development Environment

If you are starting with this post I recommend actually starting with a previous post introducing AIR for Android Development. There is a ANT file there that you will want to have.
Once you have your project set up (Flash Professional or Flash Builder) and all the required downloads from the earlier post we still need to do some setup before we can start running the emulator and releasing to your Android device.
This is where that ANT file will really help your development. What we need to be able to do is startup the Android SDK and AVD Manager, download some packages, and set up some virtual devices. Only once this is done can we create emulators of different types and start installing.
Before going down the next steps make sure to set up your build.properties. Once you have all your paths set correctly we’ll be ready to move forward. What you don’t realize is you already have a working development environment, now let’s see how to use our environment.
Information on how to use the command line for all your commands is in the Android Development Guide. I’ve just made it a bit easier by providing a preconfigured ANT file.
Starting up the Android SDK and AVD Manager
The next few steps all take place in the provided Android SDK and AVD Manager. To startup the manager is very simple, with ant execute the start_up_manager target.
With this command properly called the java app should start right up and you should see this.

On the first startup you won’t have any listed virtual devices. We’ll need to add those in.
Select and Download Packages
Before we can create a virtual device you need to go get some packages for your device to run on.

Go to Available Packages and select the packages you want to download. Depending on the amount of packages you select you may be here a long time – I just did them all because I am crazy like that. I’d recommend getting a drink right about now.
Once all the packages you’ve selected are downloaded the waiting is over, we can get moving now.
You can go through your finder/browser and see the downloaded packages in your platforms folder.

Setup Your Android Virtual Devices
With your packages downloaded we can now create our virtual devices on the Virtual Devices window.

Now you can go to New… and create a new Virtual Device.

The final thing that you need to do is to add abilities to your new virtual device by adding hardware specifications.


Once you have your virtual device set up we can run it as an emulator. You can set up as many of these as you like so don’t hold back.
With your platforms downloaded you can also set up your AVDs through the ANT file by calling the following command.
$ ant -buildfile build.xml create_virtual_device
Startup the Emulator
Once you have some virtual devices set up you can just click on Start… and startup the emulator, ready for installing and testing.
You can also do this through the ANT file by calling the following command.
$ ant -buildfile build.xml start_emulator
Install the AIR Runtime on the Emulator or Android Device
These next parts require going either through the ANT file or command line. For the ANT file installing the AIR Runtime on the emulator is extremely simple. With your Emulator started up just call the following ant command.
And for an Android Device just call:
The provided scripts expects that there will only be one emulator and/or one device connected at a time.
Install your Application on the Emulator or Android Device
Installing an Application on the emulator or Android Device is extremely simple – just as simple as installing the Runtime. With your Emulator started up just call the following ant command.
And for an Android Device just call:
The provided scripts expects that there will only be one emulator and/or one device connected at a time. The ANT script currently recompiles and builds the application and then deploys it to the target device.
DONE!
Once you have done all of this you will have a working development environment up and going. Good luck in your Adventures with Android.








[...] – Managing the Android Development Environment [...]
[...] This post was mentioned on Twitter by Jonathan Campos, Hicham Taoufikallah. Hicham Taoufikallah said: RT @jonbcampos: Instructions on how to manage your AIR for Android Development Environment http://bit.ly/bOl7nr [...]
[...] to build a multi-screen air application I stumbled on a couple articles by Jonathan Campos about Android Air Development. So I must admit that a lot of the ground work was allready done by both Jonathan [...]
[...] World in Flash Professional with Air for Android Hello World in Flash Builder with Air for Android Managing your Air for Android Environment Optimization Techniques for Air for [...]