Game Development Reference
In-Depth Information
The emulator works almost exactly like a real device, and you can interact with it via your mouse
just as you would with your finger on a device. Here are a few differences between a real device
and the emulator:
ï?®
The emulator supports only single-touch input. Simply use your mouse
cursor and pretend it is your finger.
ï?®
The emulator is missing some applications, such as the Google
Play application.
ï?®
To change the orientation of the device on the screen, don't tilt your monitor.
Instead, use the 7 key on your numeric keypad to change the orientation.
You have to press the Num Lock key above the numeric keypad first to
disable its number functionality.
ï?®
The emulator is very slow. Do not assess the performance of your
application by running it on the emulator.
ï?®
Emulator versions prior to 4.0.3 only support OpenGL ES 1.x. OpenGL ES
2.0 is supported on emulator versions 4.0.3 and newer. We'll talk about
OpenGL ES in Chapter 7. The emulator will work fine for our basic tests.
Once we get further into OpenGL, you'll want to get a real device to test
on, because even with the latest emulators that we've used, the OpenGL
implementations (virtualized and software) are still a little buggy. For now,
just keep in mind that you should not test any OpenGL ES applications on
the emulator.
Play around with it a little and get comfortable.
Note Starting a fresh emulator instance takes considerable time (up to 10 minutes depending
on your hardware). You can leave the emulator running for your whole development session so you
don't have to restart it repeatedly, or you can check the Snapshot option when creating or editing
the AVD, which will allow you to save and restore a snapshot of the virtual machine (VM), allowing
for quick launch.
Sometimes when we run an Android application, the automatic emulator/device selection
performed by the ADT plug-in is a hindrance. For example, we might have multiple devices/
emulators connected, and we want to test our application on a specific device/emulator. To deal
with this, we can turn off the automatic device/emulator selection in the Run configuration of the
Android project. So, what is a Run configuration?
A Run configuration provides a way to tell Eclipse how it should start your application when
you tell Eclipse to run the application. A Run configuration usually allows you to specify things
such as command-line arguments passed to the application, VM arguments (in the case of
Java SE desktop applications), and so on. Eclipse and third-party plug-ins offer different Run
configurations for specific types of projects. The ADT plug-in adds an Android Application Run
configuration to the set of available Run configurations. When we first ran our application earlier
 
 
Search WWH ::




Custom Search