My love / hate relationship with my phone
Posts tagged Android SDK
Droid Screen Capture – How To
Nov 28th
In getting ready to start posting to this blog I noticed a lack of cohesive documentation on how to perform screen captures from the Droid. After reading a few different posts on the subject and ‘reading between the lines’ via trial and error, I finally got it. In order to assist others that would like to have this functionality I’m posting this “How To”.
Before I begin, let me give you a little background. There are several android applications that purport to provide screen capture services. Both Screen Capture by Alexandre Thiel and drocap2 for root users require “root device” access in order to operate. Acquiring “root device” access is a technical procedure to get security clearance that exposes certain aspects of the Android operating system that Google did not intend to make readily available to the average user. I’m not a fan of such procedures, it reminds me of jailbraking an iPhone - I guess I’m just not quite that geeky. If you are interested I did find this guide to ‘rooting your android G1’ – it looks too scary for me, plus it’s not for Android 2.0. Additionally, dxtop home alternative offers a $2.99 application that does quite a few things including screen capture. However when I tested it, it could not capture screens while I was placing calls – so I gave up on it. I imagine that someone soon will create an application to get screen captures that works without rooting your phone and that will allow capture of all the screens (including phone calls). At the end of the day I proceeded with a Google supported method that leverages their SDK (software development kit), this guide will describe this method. Giving credit where credit is due, I got started by trying to follow this guide – however the author has the first two steps out of order. Unfortunately, it took me hours to figure this out. So, here’s the guide.
Let’s start with the stuff you need to do on the Droid itself. Perform the following before connecting the USB cable to your computer.
Now let’s load some software on your PC.
First you’re going to need the Android SDK. You can download it from http://developer.android.com/sdk/index.html. I’m using Vista, the documentation indicates that only XP and Vista are supported – I don’t know what to tell you if you’re using Windows 7. I grabbed the following:
Save the file to the directory of your choice.
Unzip the contents to the directory of your choice.
Find the unzipped files and run “SKD Setup”
For the next step, I found it necessary to close my browser (otherwise one of the components failed – I’m not 100% sure it was due to the open browser, but closing it seemed to help me). When you run ‘SDK setup’ do the following:
Sit back, grab a beer, play a game… it’s going to take about 15 minutes to complete the installation (at least it took that long for me – I have a 20Mb cable connection). After this process completes, go ahead and quit out of the SDK setup application.
The next thing you’re going to need is copy of the Java SE Development Kit (JDK). Java is the platform for Android, so this makes sense. You can get your copy at http://java.sun.com/javase/downloads/index.jsp
I chose the following package:
Next they’ll ask you to fill out their form with your name, email, etc., but there is an option to skip it… I did. A new browser window will popup asking for your platform and language, fill it out according to your needs then click “continue”:
Next you will receive a new window identifying the required files for your install. Check the box(es) next to the files and either click “Download Selected with Sun Download Manager” (which will require downloading and installing their download manager software) or simply click the file name and get it the old fashioned way:
Next chose to “Run” the application:
Is your beer gone? If not, this is a good time to finish it or get another one. It took me about 12 minutes to download and install this package. BTW.. I just took all of the default settings to install the Sun JDK package (sorry, no screen shots).
Now according to Google your system is not quite ready for development until you get yet another set of tools for developers. They recommend using a package called Eclipse. However, for simple screen capture, this is not required so I’m skipping this step.
Now we’re ready to install the USB drivers for the Droid. This is where I got confused. Since the Droid is a multifunctional device, you’ll see a number of places in your device manager that relate to the Droid. The fact of the matter is that after you set the Droid for “USB debugging” Windows won’t even load the required driver for development purposes. When you installed the Google SDK it placed the driver files in one of its folders. You’ll find them in the folder you unzipped the Google SDK in earlier. Before you continue, make sure you know where these are. It’ll look something like:
Next up—install the driver. Plug your Droid into your USB cable. If you’re running Vista you’ll get a popup, choose to locate the driver:
Windows Vista will try to locate the drives auto-magically, but in the end it will present you with another popup – select “I don’t have the disk, show me other options”.
On the next popup, select “Browse my computer for driver software”
Next click the the “browse” button:
Navigate to the location of your Google Android SDK folder and click the folder named “USB_Driver”, then click “OK”:
Once you’ve located the proper folder, click “Next”:
Now on my system, I received a warning that the driver couldn’t be verified by Microsoft. But I trust Google, so I selected to install it anyway (I don’t know if you’ll get this warning or not).
After a few seconds I received a message in the Vista tray that the new hardware was properly installed.
Now the fun begins (finally). In order to capture the screen of your Droid, you need to run a program called “ddms”, it’s located in the “tools” folder of the Google Android SDK folder (just double click it):
Once you start the application, two windows will open: a windows command window (the black one) and the “Dalvik Debug Monitor”:
Just ignore the Windows command window (but don’t close it) – minimize it if you want.
From Dalvik Debug Monitor simply select Device / Screen Capture to get whatever is currently being seen on your Droid:
You’ll get a new window where you can copy the image to your windows clipboard and do whatever you want with it:
So there you have it. Now you can perform screen captures from any screen on the Droid. This will be a handy tool for me for this blog – I hope it helps someone.
BTW, I’ve read there is some software available to augment this process that will display 6 frames per second of the Droid screens so you can perform demonstrations (via a projector / web cast / etc.) on an actual Droid rather than using some sort of emulator. If I have time, I’ll figure this out and post another how-to later. Cheers!
Join the forum discussion on this post – (1) Posts
