33

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.

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?

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.

Cœur
  • 32,421
  • 21
  • 173
  • 232
Josef
  • 2,430
  • 5
  • 29
  • 56
  • possible duplicate of [Android USB host-to-serial connection?](http://stackoverflow.com/questions/6928306/android-usb-host-to-serial-connection) – Bergi Jul 20 '15 at 10:25

3 Answers3

16

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.

Frank D.
  • 1,286
  • 1
  • 12
  • 23
5

There is a project dedicated to serial communication on Android. android-serialport-api. I think, it is a good resource to start with.

FTDI also provides Android related resources.

yegorich
  • 4,302
  • 3
  • 27
  • 34
  • 2
    Just to add, I believe the serialport-api link mentioned requires the device to be rooted to access the USB port. The FTDI application however doesn't, so I would vote for that. – Single Entity Mar 23 '15 at 13:33
4

I think there's currently only one properly maintained library for serial USB communication and it's felHR85/UsbSerial. It supports several USB chips including FTDI (see Devices Supported).

Unfortunately mik3y/usb-serial-for-android seems to be dead.

And no, you don't need to root your device for connecting to and communicating with a USB device.

EDIT: We have a maintained fork of mik3y's library. See kai-morich/usb-serial-for-android

EDIT2: It seems that all of these libraries are maintained again, mik3y joined forces with kai-morich and they are working together.

Jakub Turcovsky
  • 1,955
  • 3
  • 25
  • 38