Is there a library commonly used for USB serial communication on Android?

Asked 2 years ago, Updated 2 years ago, 84 views

I would like to connect the Android device to the device via USB for serial communication. (Android is the host)

I searched the Android API reference and found a class called Android.hardware.usb.
https://developer.android.com/reference/android/hardware/usb/package-summary
https://developer.android.com/guide/topics/connectivity/usb/host#java

This will be my first time developing Android, but I will use the above class to communicate with USB. Is it common to create your own class drivers?
For example, is there a library where you can easily communicate with USB, such as the SerialPort class in the .NET Framework?
I can find several libraries such as usb-serial-for-android when I search on the web, but is there anything reliable?
https://github.com/mik3y/usb-serial-for-android

[Development Environment]
Operating System: Windows 10 Pro 64bit IDE: Android Studio 3.2
languages:Java

(Additional)
I have attached the configuration diagram that I expected.configuration diagram

android usb serial-communication

2022-09-30 16:51

1 Answers

Typically, a dedicated IC is used to mediate between USB and serial communication, and the driver corresponding to that IC is used.

For example, a USB serial conversion chip from Future Technology Devices International (FTDI) is common.
These commonly used chip drivers may be provided by the manufacturer, so you don't have to make your own.

First of all, you should check what kind of ICs are used and search the web by the model number and driver.


2022-09-30 16:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.