Sams Teach Yourself Java™ in 24 Hours (Covering Java 7 and Android)

(singke) #1
ptg7068951

Running the App 353

The Android emulator loads in its own window. This can take a minute or
more, so wait patiently as the fake phone boots up. (The emulator is so
slow to load it gives you time to ponder this Chinese proverb: “The oxen
are slow but the earth is patient.”)


The emulator displays “Saluton Mondo!” as the text and title bar of the
app, as shown in Figure 24.7. Controls enable the emulator to be used like
a phone, but with a mouse instead of your finger. Click the back button to
close the app and see how the Android device is emulated.


Back

FIGURE 24.7
Running an app in the Android
emulator.

An emulator can do many of the things a real device can do, including
connect to the Internet if the computer has an active connection. It also can
receive fake phone calls and SMS messages.


Because it’s not a fully functional device, the apps that you develop must
be tested on actual Android phones and tablets.


If you can connect an Android phone (or other device) to your computer
using a USB cord, you should be able to run the app if the phone is set in
debugging mode. Apps developed with the Android SDK can be deployed
only on a phone in this mode.

Free download pdf