Is there a way to inject keystrokes into the JVM on the Android platform?
I'm looking for something like java.awt.Robot but I don't think that's available on Android
thanks
Is there a way to inject keystrokes into the JVM on the Android platform?
I'm looking for something like java.awt.Robot but I don't think that's available on Android
thanks
听起来您需要 InstrumentationTestCase.sendKeys()
http://developer.android.com/reference/android/view/KeyEvent.html
您可以使用:
$ adb -s <serialno> emu event send <event>
其中事件描述可能类似于:
"EV_KEY:KEY_A:1"
好吧,我实际上正在开发 android (synergy-foss.org) 的 Synergy 端口,我认为在设备本身上伪造击键的最佳(也是唯一方法)是写入 /dev/input/uinput。但是,这似乎仅适用于 Cyanogen mod