EMULATING REAL DEVICES

Besides using the Android emulator to test the different configurations of Android, you can also make use of the emulator to emulate real devices, using the system images provided by device manufacturers.

For example, HTC provides images for their devices running Android 1.5 and 1.6 (http://developer.htc.com/google-io-device.html#s3). You can download a device’s system image and then use the Android emulator to emulate it using the system image. Here is how this can be done (in theory, this should work for any version of Android).

image

NOTE If you use HTC’s image, you should be able to boot up the emulator without problems. However, the network cannot be enabled. Some kind souls have uploaded a modified image that works properly. You can try downloading it at www.4shared.com/get/x6pZm3-W/system.html.

First, using the Android SDK and AVD Manager, create a new AVD. In the case of HTC, create an AVD using Android 1.6 as the platform. The AVD will be located in the C:\Users\<username>\.android\avd\<avd_name>.avd folder. As shown in Figure B-8, a newly created AVD contains only two files in the folder.

Using the downloaded system image, copy the system.img file into the AVD folder (see Figure B-9).

Launch the AVD and you should see it booting ...

Get Beginning Android now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.