通过Android与串行USB设备通信

通过Android与串行USB设备通信

问题描述:

我有一个定制的测量电流的设备.该设备可以连接到PC,并通过USB进行通信.它基于FTDI芯片.我有用Java编写的应用程序,并且该应用程序正在使用rxtxSerial.dll库和gnu.io.rxtx_2.1.7.4.jar.现在,我想将此应用程序移植到我的android设备上,我有点困惑该怎么办?我所拥有的只是android平板电脑(操作系统版本4.1.1),OTG电缆和此测量设备.

I have one custom made device for measuring current. This device can be connected to PC and communication is done over USB. It is based on FTDI chip. I have application written in Java and that application is using rxtxSerial.dll library and gnu.io.rxtx_2.1.7.4.jar. Now I want to port this application on my android device and I'm litte bit confused what to do that? All I have is android tablet (os version 4.1.1), OTG cable and this measuring device.

我的设备应该植根吗?我可以简单地添加到Java Android应用程序中并通过USB读取数据的任何类型的库吗?从哪里开始?

Should my device be rooted? Is there any kind of library that I can simply add to my Java Android application and read data over USB? Where to start?

我试图使用相同的库将现有的PC应用程序移植到PC,但是rxtxSerial.dll丢失了,我无法将其传输到我的android设备上.

I have tried to port existing application for PC using same library, but rxtxSerial.dll is missing and I can't transfer it to my android device.

我真的可以推荐USB-Serial-For-Android库,它支持多种流行的USB到串行芯片(也包括FTDI),而且没有根必需的.在此处查看GitHub项目.

I can really recommend the USB-Serial-For-Android library, it supports multiple popular usb-to-serial chips (also FTDI) and there is no rooting required. Check out the GitHub project here.