Setting Up Your Phone

The Android SDK includes an emulator that acts like an Android phone and can run the apps you create. This comes in handy as you’re writing an app because you can get it working in a test environment, but at some point you need to see how it works on an actual Android phone (or other device).

You can deploy apps you write with the SDK on an Android device over your computer’s USB connection. You can use the same cord you use to transfer files to and from the device.

Before connecting the cord, you must enable USB debugging on the phone by following these steps:

1. On the phone’s Home screen, choose Menu, Settings. The Settings app opens.

2. Choose Applications, Development and check the USB debugging box.

Figure D.4. Using an Android phone in USB debugging mode.

Image

Other devices might have this option elsewhere in the settings. It is called something like USB connection mode, USB debugging, or the like. The Android site at http://developer.android.com has documentation for how to set this for different Android devices.

Connect the USB cord to your computer and the other end to your phone. A small bug-like Android icon should appear along the top edge of the device alongside the time and icons for connection bars and the battery.

Drag the top bar down. You should see the USB Debugging Connected and USB Connected messages (see Figure D.4).

This sets up your phone, but your computer also might require configuration to be able to connect to the device. If you have never connected to the phone over a USB cord, check your phone’s documentation for how to do this. You might need to install a driver from a CD that came with the phone or the manufacturer’s website.

On Windows, the Android SDK and AVD Manager run from within Eclipse, and you can use them to download the USB Driver Package, a collection of drivers for various phones and other devices, and other packages related to your device. Choose Window, Android SDK, and AVD Manager to see what’s available.

During Hour 24, you use the Android development tools to create and run an Android app. If everything’s set up correctly,  it should run properly on both the emulator and an Android phone.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.82.26