Design

Android on x86: Understanding Android Device Emulation

By Iggy Krajci and Darren Cummings, September 17, 2013

Building customizable emulators and setting up the appropriate environments for developing applications.

Before using the Gingerbread Intel architecture images with the x86 emulator, you must create an AVD configuration that specifies the required software and hardware customizations. We'll discuss AVDs shortly, but more detailed information can be found in the article Android Virtual Device Emulation for Intel Architecture.

At this point, your emulator and x86 image are ready to use. Please note that the emulator performance will see drastic improvements if you use Intel Hardware Acceleration Execution Manager (Intel HAXM) in conjunction with this system image  without it, performance may vary. (Intel HAXM requires an Intel processor with Intel VT-x support.)

Using the Gingerbread x86 Emulator

Now it's time to use the Gingerbread x86 emulator to emulate an x86 image.

Open the Android tool or bring up the AVD creation tool directly from Eclipse. Figures 6 and 7 show the creation of an AVD for Gingerbread with an Intel Atom (x86) CPU.

Figure 6: New AVD creation.

Figure 7: Success dialog box.

Test the x86 Gingerbread AVD by selecting the AVD and clicking on Start, as shown in Figure 8.

Figure 8: Launch options.

Figure 9 shows the home screen of the Gingerbread for Intel Atom (x86) on emulator-x86, and Figure 10 shows the About Phone view.

Figure 9: Home screen.

Figure 10: About Phone view.

It is recommended that you use the x86 emulator with Intel VT hardware acceleration. On Linux, this can be done using the Linux KVM. Ubuntu has further documentation on how to configure and use it.

Conclusion

Creating and testing diverse applications for the Android ecosystem is greatly facilitated by the use of virtual devices. This article provided guidance for downloading the Android Software Development Kit, choosing an emulator, customizing the Android Virtual Device, and getting the best performance from Gingerbread x86 emulation.

The Android on x86 Field Guide is filled with specific advice for optimizing software for devices using Intel's popular line of microprocessors, and customized, emulated devices are one of the most precise tools for this endeavor. If you're interested in further information on this subject, the book compiles best practices and procedures for general and highly optimized Android development.

Iggy Krajci is employed as a software engineer at Cummings Engineering where he works on developing for the Android platform and its incorporation in the x86 ecosystem. Darren Cummings is CEO and founder of both Cummings Engineering and Secure Agile Interoperable Framework for the Enterprise (SAIFE) security-as-a-service. This article is based on material found in the book The Android on x86 Field Guide, Copyright Apress 2014. All rights reserved.

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task.
However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Video

This month's Dr. Dobb's Journal

This month,
Dr. Dobb's Journal is devoted to mobile programming. We introduce you to Apple's new Swift programming language, discuss the perils of being the third-most-popular mobile platform, revisit SQLite on Android
, and much more!