Pages

Ads 468x60px

Tuesday, 4 June 2013

Creating Android Virtual Devices (AVDs)

Creating Android Virtual Devices (AVDs)

The next step is to create AVD to be used for testing your Android applications. AVD stands for  Android Virtual Devices. An AVD is an emulator instance that enables you to model an actual device.

Each AVD consists of a hardware profi le, a mapping to a system image, as well as emulated storage, such as a secure digital (SD) card.

You can create as many AVDs as you want in order to test your applications with several different confi gurations. This testing is important to confi rm the behavior of your application when it is run on different devices with varying capabilities.

To create an AVD, go to Windows ➪ Android SDK and AVD Manager.
Select the Available packages option in the left pane and expand the package name shown in the right pane. Figure below shows the various packages available for you to create AVDs to emulate the different  versions of an Android device.

.

Check the relevant tools, documentation, and platforms you need for your project.
Once you have selected the items you want, click the Install Selected button to download them. Because it takes a while to download from Google’s server, it is a good idea to download only whatever you  need immediately, and download the rest when you have more time.

Each version of the Android OS is identifi ed by an API level number. For example, Android 2.3 is  level 9 (API 9), while Android 2.2 is level 8 (API 8), and so on. For each level, two platforms are available. For example, level 9 offers the following:

➤➤ SDK Platform Android 2.3
➤➤ Google APIs by Google Inc.

The key difference between the two is that the Google APIs platform contains the Google Maps  library.
Therefore, if the application you are writing requires Google Maps, you need to create an AVD using the Google APIs platform (more on this in Chapter 9, “Location Based Services.”
Click the Virtual Devices item in the left pane of the window. Then click the New… button located in the right pane of the window.

In the Create new Android Virtual Device (AVD) window, enter the items as shown in Figure below  Click the Create AVD button when you are done.


In this case, you have created an AVD (put simply, an Android emulator) that emulates an Android device running version 2.3 of the OS. In addition to what you have created, you also have the option  to emulate the device with an SD card and different screen densities and resolutions.

It is preferable to create a few AVDs with different API levels so that your application can be tested on different devices. The example shown in Figure 1-18 shows the many AVDs created to test your applications on a wide variety of different Android platforms.







0 التعليقات:

Post a Comment

.

Education blog