Channels ▼
RSS

Design

Android on x86: Understanding Android Device Emulation


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.

Android on x86 Field Guide
Figure 6: New AVD creation.

Android on x86 Field Guide
Figure 7: Success dialog box.

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

Android on x86 Field Guide
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.

Android on x86 Field Guide
Figure 9: Home screen.

Android on x86 Field Guide
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.

With KVM, shown in Listing Seven (-enable-kvm), users will likely notice performance boosts during Android boot along with quicker emulator responsiveness.

Listing Seven.

$ emulator-x86 –avd gbx86 –qemu –m   512 –enable-kvm

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.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

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.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 

Video