Android serial communication package okusb example code
This paper introduces the sample code of okusb, which is encapsulated by Android serial communication, and shares it with you. The details are as follows:
GitHub portal: okusb
OkUSB
A concise Android serial communication framework.
Function introduction
Usage introduction
Gradle
Specific usage
1. Add the following features in androidmanifest.xml:
Add the following to the activity that needs to be connected to the serial port:
2. Create an XML folder in the res folder and create a new device_ filter.xml
3. The front is all preparatory work, which is really used here.
4. if you are Activity, you can call the following code in onDestroy to close the serial port.
License
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.