Invoke the keypress event in Android?

I need to invoke a key press event in android . Any suggestions ?????


You need to use the instrumentation class :

Instrumentation i = new Instrumentation();
i.sendKeyDownUpSync(KeyEvent.KEYCODE_A);

This should be equivalent to a A pressed on the keyboard.