Android 3.0. 1
Grady 4. 1
ARM development edition: RK3399
PC: Win 10
Machine development: MAC 10. 13.3.
Take pictures first
Because the so in the android-serialport-api project is compiled with the old ndk, it will be reported that DLOPEN failed when it is compatible with Android version 6.0 or above: "hastext relocations". And compile with mk, especially upgrade to compile with cmake.
Upgrade android-serialport-api.
Project structure:
App corresponds to each activity in the original project, modules corresponding to so before androidserial compilation, and encapsulation of API. You can directly refer to androidserial, and call the method to refer to the activity in the app directory.
Pay attention to permissions!
When accessing the development board, if you find an error that you don't have serial port read/write permission and need root permission, open root permission adb and open the application in developer mode.
Use a command to open Android's read and write access to the serial port.
Setenforce 0: Turn off the firewall. Some people say this is the key, but my environment doesn't need to be closed, just give me permission.
Note that ttyS 1-6 ttyS 1-6 corresponds to UART serial port 1-6, which is generally one-to-one. This depends on the instructions of the development board.
The record is rough, please forgive me. Please leave a message if you have any questions, and I will definitely reply when I see it. The project mainly depends on the structure, and the rest are copied and pasted. Git address: /braincs/AndroidSerialLibrary