Setting up an Android Virtual Device (AVD)
In my recent post on How to Set-up your System to Run Android I covered the basic steps to get your system (MAC) up and running with the Android SDK. Now that you have Java, Eclipse and all the necessary files from Google installed, you’re now ready to start programming. The only problem remaining is you need an emulator, or Virtual Device, that can simulate an Android phone.
The good news, you have this already installed as part of setting up your system to run Android. All you need to do is configure the AVD.
Steps to get the AVD up and running:
- Start Eclipse
- Under the menu “Window” select “Android SDK and AVD Manager”
- When the window opens you will see “Virtual Devices” in the left pane
- Click on the “New…” button
Creating an Android Virtual Device: Settings
- In the “Name:” field, give the virtual device a name. I would recommend that you start with “Android” and then the target OS they you plan on using. If you are going to build for Android devices that are 2.1 and higher call it “Android-21”.
- For the “Target” pick one of the “Android x.x” APIs.
- For “SD Card” you can type in 512 Mib which is a safe and standard size.
- Under “Skin:” As a good practice you can go with HVGA as this is a standard 320 x 480 screen resolution for most android devices
What I like about the Android Virtual Device is you can create multiple virtual devices. This is why I recommend that you put the OS version in the name, such as “Android-15” (Version 1.5) or “Android-23” (Version 2.3). If you are going to be releasing your application out into the real world you’ll need to make sure it works on as MANY devices as possible otherwise you may get a bad review from an unhappy customer. I’ve have read that we, as programmers, should target Android devices all the way down to 1.5 and a lot of books out on the market say the same thing.
While I’m all for this, if you look at Google’s breakdown on Android OS market share, users are predominantly on 2.1 and up. This accounts for 97% of the market! Therefor I think that targeting versions 1.5 is a little drastic these days and it’s only going to get smaller and smaller as time goes on.
Now that you have a Virtual Device set up you can start programming and seeing what your application will look like. To run the AVD simply click on the green play button (for lack of better words) in the icon bar found in Eclipse.
What the Android Virtual Device Looks Like