Workshop
Quiz
-
Which features are available in the DDMS perspective?
- Taking screenshots of emulator and handset screens
- Browsing the file system of the emulator or handset
- Monitoring thread and heap information on the Android system
- Stopping processes
- Simulating incoming phone calls and SMS messages to emulators
- All of the above
-
True or False: You must use the Android emulator for debugging.
-
Which target platforms can Android applications be written for?
-
True or False: The Android emulator is a generic device that supports only one screen configuration.
Answers
-
F. All of the above. The DDMS perspective can be used to monitor, browse, and interact with emulators and handsets in a variety of ways.
-
False. The Android emulator is useful for debugging, but you can also connect the debugger to an actual device and directly debug applications running on real hardware.
-
There are a number of target platforms available and more are added with each new SDK release. Some important platform targets include Android 1.6, Android 2.1, Android 2.2, Android 2.3, and Android 3.0. Targets can include the Google APIs, if desired. These targets map to the AVD profiles you must create in order to use the Android emulator.
-
False. The Android emulator is a generic device, but it can support several different skins. For a complete list of skins supported, see the Android SDK and AVD Manager.
Exercises
-
Launch the Android emulator and customize your home screen. Change the wallpaper. Install an AppWidget. Get familiar with how the emulator tries to mimic a real handset. Note the limitations, such as how the dialer works.
-
Launch the Android emulator and browse the Settings application. Try changing a setting and see what happens. Uninstall an application (Settings, Applications, Manage Applications, click on an application and press the UnInstall button, then confirm with the OK button to uninstall an application). Under the About phone submenu, check the Android version.
-
Launch the Android emulator and browse the Dev Tools application. Review the settings available, especially those within the Development Settings submenu. Check out the documentation for this tool on the Android Developer website at http://goo.gl/QcScV.
-
Launch the Android emulator and add a few test contacts to your Contacts database for this AVD. If you give a contact the phone number you like to use for incoming calls from the DDMS perspective, the contact's name and picture display whenever that phone number is used for testing purposes.
-
Add a new image file to your emulator instance. Find a JPG graphic file, such as a photo, and use the DDMS perspective's File Explorer to push the file to the /mnt/sdcard/download directory of the emulator. Launch the Gallery application and if the image does not immediately appear, then use the Dev Tools application to perform a media scan and re-launch the Gallery application. After the graphic is visible in the Gallery, go create a contact and set the contact's photo to that photo.