0

I want to have Serial Communication between Android Device and Linux Ubuntu Laptop.
I am targeting Android version Oreo-8.0 API Level–27.
Android phone and Laptop will be connected over Micro USB(Android) to USB(Linux).

On Android I found below Answers useful for Serial Communication:

  1. Android USB host-to-serial connection?
    : Answer talks about using external libraries like https://github.com/felHR85/UsbSerial
  2. How to read and write data to COM/Serial ports in Android?
    : Answer talks about using Android provided APIs

Question: Do we need to use external libraries to access/read/write Micro USB Serial Port on the Android mobile, or Android SDK provided the necessary APIs for Serial Communication?

User7723337
  • 11,857
  • 27
  • 101
  • 182
  • If you are using the Android USB Host feature, Android does provide the API for the USB host connection. With this API, you can create your own USB-Serial Host driver or just use any of the third-party USB-serial host libraries available on GitHub (felHR85 or mik3y), which provide the support for common USB-Serial adapters from FTDI, Prolific, SiLabs, and, Qinheng. To make it work, there must be two or more USB endpoints exposed by the Android Linux kernel when it establishes the USB host connection with any USB-Serial adapter through /dev/ttyUsb. – ecle Oct 24 '20 at 05:21
  • If you used a certain USB-serial adapter (e.g. Digi Edgeport/1 or Cypress CY7C6521x), then you are out of luck since these third-party libraries don't support them even though the Linux kernel in your Android device supports them. In the case of Digi Edgeport/1, Android only exposed only one USB endpoint so it may not work. – ecle Oct 24 '20 at 05:21

0 Answers0