摘要:
最近在做有关于Remote Controller 的功能,该功能把手机做成TV的遥控器来处理。在手机的客户端发送消息到TV的android 服务端,服务端接收到客户端的请求消息,模拟KeyEvent命令,发送Key值。最简单的发送命令为如下代码:publicstaticvoidsimulateKeystroke(finalintKeyCode){newThread(newRunnable(){publicvoidrun(){//TODOAuto-generatedmethodstubtry{Instrumentationinst=newInstrumentation();inst.sendKe 阅读全文