Managing Android Virtual Devices

To run an application in the Android emulator, you must configure an Android Virtual Device (AVD). The AVD profile describes the type of device you want the emulator to simulate, including which Android platform to support. You can specify different screen sizes and orientations, and you can specify whether the emulator has an SD card and, if so, its capacity. In this case, an AVD for the default installation of Android 2.1 will suffice. Here are the steps for creating a basic AVD:

1. Launch the Android SDK and AVD Manager from within Eclipse by clicking on the little green Android icon with the arrow ( a ) on the toolbar. You can also launch the manager by selecting Window, Android SDK and AVD Manager in Eclipse.

2. Click the Virtual Devices menu item on the left menu. The configured AVDs will be displayed as a list.

3. Click the New button to create a new AVD.

4. Choose a name for the AVD. Because you are going to take all the defaults, name this AVD VanillaAVD.

5. Choose a build target. For example, to support Android 2.1, choose the item build target called Android 2.1 - API Level 7 from the drop-down.

6. Choose an SD card capacity, in either kibibytes or mibibytes. This SD card image will take up space on your hard drive, so choose something reasonable, such as a 1024MiB or less. (The minimum is 9MiB, but keep in mind that the full size of the SD card is stored on your machine.)

7. Choose a skin. This option controls the different visual looks of the emulator. In this case, go with the default HVGA screen, which will display in portrait mode.

Your project settings should look as shown in Figure 1.4.

8. Click the Create AVD button and wait for the operation to complete.

9. Click Finish.

Because the Android Virtual Devices Manager formats the memory allocated for SD card images, creating AVDs with SD cards may take a few moments.

FIGURE 1.4

Creating a new AVD in Eclipse.

0 0

Post a comment