Logo Icon Logo
A Crowd-sourced Cookbook on Writing Great Android® Apps
GitHub logo Twitter logo OReilly Book Cover Art

Getting Screenshots

Published? false
FormatLanguage: WikiFormat

Problem:

You need a standard way of getting screenshots for use in the Android Cookbook or any other documentation.

Solution:

Use ddms Device->Screen Capture, and save to disk.

Discussion:

The Dalvik Debug Monitor Service has a variety of uses. In this recipe we'll only talk about using it to get screen shots of your running device or emulator. The device does not have to be "rooted" for this to work, unlike many other methods of screen capture.

Start DDMS from the command line (it's in the tools directory of the SDK). After a startup delay you will see the home screen (if you also have Eclipse running (see Hello World - Eclipse Version), there will be some conflict messages, which would be bad if you were debugging but are harmless here.

Select the Device menu and Screen Capture.

Ddms will communicate with the device and display the current screen contents in a dialog.

Click this button's Save button for a standard File Save dialog.

You can then upload the screen shots here, or use them in any other documentation tool. Here's how the same screen capture above would look.