views:

647

answers:

2

I was wondering if there is a way to take a screenshot of the current screen inside the mobile phone using a service (I know how to do it through DDMS though)

+1  A: 

Not without root access.

Quintin Robinson
Oh... that is interesting... How would I do that with root access? I can at least try it out on the emulator...
Legend
Since it requires root access, the answer won't be in the SDK. I would look at Linux system utilities that the device has installed, and figure out what command line string to execute on the device.
Klondike
I don't have any source that does this sorry, Koushik Dutta made an application I believed he used a hack in the source to trigger the same mechanism that DDMS uses to take it's screen shots.. he has a page up about the app, you will probably find a lot more information on xda developers (android development forum section). Here is the link I was talking about: http://www.koushikdutta.com/2008/11/android-screenshot-application.html
Quintin Robinson
Looks cool... Thanks... I will dig through the code... Thank You
Legend
+2  A: 

Just for encouragement I would like to say that on Android Developer Challenge 2 there is an application called 'drocap' that does exactly this - takes screenshots on the phone. This is running on my stock european Hero, so no root access required.

But I have no idea how it works. So - keep looking ;)

JaanusSiim
Could you point me to the source of this app? Or do they even have their source out there?
Legend