简体   繁体   English

键盘楔入Android USB设备

[英]keyboard wedge device into android usb

I have a measurement device which sends data as keyboard wedge when connected to a PC. 我有一个测量设备,当连接到PC时,它会以键盘楔形形式发送数据。 I would like to be able to use it to input data into an Android phone or tablet through the USB port. 我希望能够使用它通过USB端口将数据输入Android手机或平板电脑。 Anyone have an an idea if Android device USB port can be used in that way? 有人知道是否可以通过这种方式使用Android设备的USB端口吗?

Only some Android devices support USB host mode, but those that do would typically recognize a keyboard as a keyboard and use it as such. 只有某些Android设备支持USB主机模式,但通常会识别出键盘并将其使用。 An adapter cable is typically required. 通常需要适配器电缆。

One problem this might present is that if your app goes to the background, you would probably lose the keyboard input as it would instead go to whatever is in the foreground. 可能会出现的一个问题是,如果您的应用程序转到后台,则可能会丢失键盘输入,因为它会转到前台的任何内容。 The Android security model, if still intact, would prevent snooping on keyboard input when not in the foreground. Android安全模型(如果仍然完好无损)将防止不在前台时监听键盘输入。

(They often support mice too - kind of funny to see a mouse cursor appear on your phone) (他们通常也支持鼠标-有趣的是看到鼠标光标出现在手机上)

根据您特定型号的Android设备,您可能可以使用此适配器或类似的适配器通过Android对USB On-The-Go的支持来连接键盘

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM