O'Reilly logo

Beginning Android™ 4 Application Development by Wei-Meng Lee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B

Using the Android Emulator

The Android emulator ships with the Android SDK and is an invaluable tool to help test your application without requiring you to purchase a real device. While you should thoroughly test your applications on real devices before you deploy them, the emulator mimics most of the capabilities of real devices. It is a very handy tool that you should make use of during the development stage of your project. This appendix provides some common tips and tricks for mastering the Android emulator.

USES OF THE ANDROID EMULATOR

As discussed in Chapter 1, you can use the Android emulator to emulate the different Android configurations by creating Android Virtual Devices (AVDs).

If you want to emulate a real device, first create an AVD with the same screen resolution and abstracted LCD density as that of your real device (see the section “Emulating Devices with Different Screen Sizes” in this appendix for how to do this). You then launch the Android emulator by directly starting the AVD you have created in the AVD Manager window (see Figure B-1). Simply select the AVD and click the Start button. If you want the emulator to display using the same screen size as a real device, check the “Scale display to real size” option and set the “Screen Size (in)” option to the size of your real device. Enter the dpi of your current monitor (if you don’t know it, click the ? button and select your monitor size and resolution). The Android emulator will then display a screen ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required