Andorid串口开发包一般使用google多年前提供的android-serialport-api, 提供自用分支
https://github.com/zealzeng/android-serialport-api...可以先使用android串口工具例如Com Assistant等, 一般串口文件是/dev/ttyS**, /dev/ttyUSB**(com转USB),波特率一般连接的硬件可设置,一般是9600, 19200...分支自带了armeabi, armeabi-v7a, x86的libserial_port.so, 一般够用, 想玩下C的可自行build, 建议使用新些的android studio 3.3, 使用cmake...Studio, read the
# documentation: https://d.android.com/studio/projects/add-native-code.html
# Sets...串口重连
串口被拔插时应用需要支持重连,在遇到InputStream,OutputStream读取返回-1或不可能恢复的问题时, 处理串口的线程应当捕获错误, 优雅关闭当前串口资源,尝试重连,保证串口应用的健壮性