![]() I will refer to the 2 sides of the USB link as the Android ![]() When I get enough time, I can come up with another example with UI and permission handling for Android 6+. There's a better way to do it with the usb4a library(usbserial4a depends on it). ![]() So after you accept the permission you need to call "open" again to use it. But by the time the system ask you for the permission, the "open" method already returned and the serial port status is still NOT open. In usbserial4a, this happens automatically when you try to open a serial port or try to call "get_serial_port". For Android 6.0+, a good news is the USB permission can be required on the fly and there are some java APIs wrapped by pyjnius to do that. For Android 4.0+(probably can down to 3.1+) you have to go through the readme of to get permission when you plug the usb device to your Android device. It anyway can not be set with the normal permissions. And this is also the reason it is somewhat complicated to set up. About the USB host permission, it's a very special one on Android.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |