Emulator and Android Device Debug

The emulator launches a window on the development computer that looks like an Android phone and runs actual ARM instructions. Note the initial startup is slow, even on high-end computers. Although there are ways to configure the emulator to try to emulate many aspects of a real Android device such as incoming phone calls, limited data rate, and screen orientation change, some features (such as sensors and audio/video) are not the same. The emulator should be considered a useful way to validate basic functionality for devices not available to the user. For example, the tablet screen size can be tried without purchasing a tablet.

Note that a target virtual device must be created before the emulator can properly run. Eclipse provides a nice method to manage Android Virtual Devices (AVD).A handy list of keyboard shortcuts for emulator functions is shown in Table 1.4.

Table 1.4 Android OS Emulator Controls

Key

Emulated Function

Escape

Back button

Home

Home button

F2, PageUp

Menu button

Shift-F2, PageDown

Start button

F3

Call/Dial button

F4

Hangup/EndCall button

F5

Search button

F7

Power button

Ctrl-F3, Ctrl-KEYPAD_5

Camera button

Ctrl-F5, KEYPAD_PLUS

Volume up button

Ctrl-F6, KEYPAD_MINUS

Volume down button

KEYPAD_5

DPAD center

KEYPAD_4, KEYPAD_6

DPAD left, DPAD right

KEYPAD_8, KEYPAD_2

DPAD up, DPAD down

F8

Toggle cell network on/off

F9

Toggle code profiling (when -trace set)

Alt-ENTER

Toggle fullscreen mode

Ctrl-T

Toggle trackball mode

Ctrl-F11, KEYPAD_7

Rotate screen orientation to previous or next layout

Ctrl-F12, KEYPAD_9

In general, the first testing is best done with an Android phone. This ensures full functionality and real-time issues that cannot be fully recreated with the emulator. For an Android device to be used as a developer platform, just hook it to the USB using the USB cable that came with the phone and ensure the USB driver is detected (this is automatic with a MAC; the drivers are included with the SDK for Windows; and see Google's web page for Linux).

Some settings on the Android device need to be changed to enable developer usage. From the home screen, select MENU^Settings^Applications^Unknown sources and MENU^Settings^Applications^Development^USB debugging to enable installation of applications through the USB cable. More details about Android debugging are provided in Chapter 12.

Character Building Thought Power

Character Building Thought Power

Character-Building Thought Power by Ralph Waldo Trine. Ralph draws a distinct line between bad and good habits. In this book, every effort is made by the writer to explain what comprises good habits and why every one needs it early in life. It draws the conclusion that habits nurtured in early life concretize into impulses in future for the good or bad of the subject.

Get My Free Ebook


Post a comment