Android USB host-to-serial connection?

Viewed 46309

Apparently with Android 2.3.4 and 3.1 one can now access USB accessories.

I have a Ardupilot Mega (based on Arduino) board with a USB cable connected to my laptop, and I can connect to it using a simple serial communications program over COM7 and 115,200 baud. This allows me into the command-line interface, and I can issue commands and get logs.

Is it possible to write an Android app that will communicate over USB to my Ardupilot Mega board?

I've seen many similar threads, but most of them were pre-USB host.

5 Answers

Unfortunately the library from mik3y's answer (see here: mik3y/usb-serial-for-android) seems to be long dead. It has many problems and waiting pull requests. Also the LGPL licence prevents anybody to fork it and maintain it.

But don't lose your hope, there's a working replacement and it's under the MIT licence. felHR85/UsbSerial.

EDIT: I found a maintained fork of mik3y's library. But the licence or readme is not updated, so I suppose the owner doesn't have a connection to mik3y and simply took it and improved it. I hope he won't get into any trouble because of the licence, because we need this 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're working together now.

EDIT3: mik3y/usb-serial-for-android is under MIT license now. And still maintained in 2022.

Related