Projecting Android on the Big Screen

Suppose you need to show off an Android application. Maybe you are making a VC funding pitch, or you are demonstrating for carriers at the upcoming Mobile World Congress, or you are explaining to a government agency how your Android app will simultaneously cure world hunger and keep tabs on area potholes.

The simplest thing to do when presenting Android to a large audience is to use the emulator, connected to a notebook, connected to a projector. This is quick, easy, and you may already have the projector if you do this sort of presentation a lot.

However, there are times when the emulator is insufficient. Perhaps the application needs actual GPS coordinates rather than faked values supplied by DDMS. Perhaps the application needs actual accelerometer movements rather than ones provided by a sensor simulator. Perhaps the application integrates with other applications that are on the device but not on an emulator (e.g., YouTube player).

You could buy or rent a device projector, but even this has issues if you need to be moving the device around (e.g., play an accelerometer-aware game).

Or, you can try DroidEx.

DroidEx extends the live device screen capturing technology built into DDMS and hierarchyviewer. It gives you a window displaying a live 6 fps (frames per second) perspective of the screen contents of an actual Android device. Since most of the work was done by the core Android team with their toolsmithing, DroidEx itself is about ~100 lines of very lightly tested code.

It also requires that the adb daemon be running, such as a development PC/Mac.

It assumes there is precisely one device plugged in or emulator running. All it does is open a window showing you the contents of that device’s or emulator’s screen.

It also suffers from the following limitations:

The screen-capture logic in Android proper seems to occasionally miss updates for some reason. I’ve seen this with DDMS and hierarchyviewer too, so I’m assuming it’s something in the Android firmware. Hence, sometimes DroidEx will appear to be a movement behind (e.g., you clicked up in a list, and DroidEx still shows the previous one as the selected item)

Once, adb or the device seemed to reject DroidEx part-way through a projection session, causing the image to freeze on DroidEx’s window and a bunch of error messages to be logged to stderr. Closing and reopening DroidEx was sufficient to clear up this condition.

Also, this was compiled against 1.0r2’s version of ddmslib.jar, so it may or may not work with other versions of the SDK.

DroidEx is a very quick and dirty hack, to solve a specific problem. It is far from perfect and may have any number of bugs. Eventually, I will clean it up and release it as open source, as there are a number of ways to extend DroidEx to make it even more useful, such as:

Doing a better job of packaging, so you don’t have to fuss with the classpath and manually specifying the class name

Allowing the frames-per-second rate to be set on the command line

Allowing you to specify which device/emulator to project, if there is more than one attached

Allowing you to save a session either as a set of still images (e.g., one every X seconds) or as a movie clip

Now in our tenth year, AndroidGuys offers daily news, reviews, editorials, and tutorials. Articles listed under this byline are comprised of those written by current and former employees of AndroidGuys as well as guest contributors and sponsors.

No, this does not require root. In fact, there’s no software running on the device itself, beyond the standard stuff that’s already on there. DroidEx uses the same services that DDMS and hierarchyviewer use for their screen images.

You’ll need the SDK installed on the projecting PC, so you have the adb daemon and such. But otherwise, that should be it.

richard

I am very impressed and looking forward to your code release.

However, lib/ddmlib.jar seems to be removed from SDK-1.5, so I guess it won’t work any more, right?

Works fine with my HTC Tattoo (1.6) but not with Samsung Galaxy S (2.1). I guess it might be the SDK issue…
Great app anyway.

WRSONG

I’m just a little confuse or not up to task for this. It not friendly for a typical user. Guess I need a step by step or even video of how to do it. Any one want to make pictorial or explain the detail detail?

Now in our 11th year, AndroidGuys loves to provide readers with the latest news and rumors as well as reviews, opinion pieces, and tools to get more from your Android. You have an awesome phone in your pocket; let us help you get more from it.