Robot class as Android classes
Possible duplicate:
Android API like java.awt.Robot
Are there any other android classes like the Robot class in java, or can we use the Robot class in android?
source to share
No, but the equivalent for you might be Instrumentation on Android.
For example, c sendKeyDownUpSync(int key)
to send synchronization up and down events to the currently focused window.
Instrumentation inst = new Instrumentation();
inst.sendKeyDownUpSync(KeyEvent.KEYCODE_MENU);
There is also a utility class TouchUtils
for simulating touch events. Although I should point out that the Instrumentation class is actually only used for testing , so it depends on what you want to achieve anyway.
source to share
If this is for testing, you can look at Robotium, http://code.google.com/p/robotium/ . This is Selenium for Android.
source to share