Saturday, August 6, 2011

Android Screen Control Without Root

The ability to control the screen of my Android phone has been a major pain since I moved from Windows Mobile to Android quite some time ago.

The only solutions required root permissions. However there are scenarios where that is not an option such as in a corporate environment / providing remote support for a device that is not your own.

Android 2.1 onwards ( as far as I know) supports a API called MonkeyRunner that is to be used for application testing. Using this along with java sources provided by "The Android Open Source Project" I have put together a small application that will capture the screen and allow passing of click and key press events to the device.

It is highly limited to the extent that it allows only for touch events and keystrokes. It currently does not support drag events and typing of special characters but something is better than nothing :)


Download the zip file from here

http://www.mediafire.com/file/a8870ynh151vm9d/ScreenControl.zip

In order to run the files, you need to ensure that the device is connected via USB cable only and debugging has been enabled on the device.

Once this is done, Fire up the screen.bat and it should load up the window. The screen.bat is a single line command calling java.exe along with all the required class and jar files required to make this work.

I have also included adb.exe which is required, you could replace with your own, however mine will probably be more stable.



Again, Consider this only if your device is not rooted. If you have rooted your device I would recommend you use the either of the following better softwares

Android Screencast
http://code.google.com/p/androidscreencast/

This works with the USB connection

Droid VNC Server by José Luis Pereira
http://www.onaips.com/wordpress/?page_id=60

This works with Wifi



I hope this has been helpful for some of you all. Am sure there are more brilliant people out there who can modify the sources to add drag functionality as well. Do let me know !


UPDATE
F.J. Wechselberger has integrated this functionality into MyPhoneExplorer through
native TCP-Calls. Its not possible for him to implement Java-Library into the PC-Program but he was able to translate the source of MonkeyRunner. I Would recommend you download this if you are looking for a simple solution for controlling the screen.

www.fjsoft.at


Cheers,
Vikram Sridharan.