mik3y / usb-serial-for-android

Android USB host serial driver library for CDC, FTDI, Arduino and other devices.
MIT License
4.81k stars 1.58k forks source link

How can I use this library to read data from serial device in background when the terminalfragment is onPause? #496

Open uniqueram opened 1 year ago

uniqueram commented 1 year ago

I have made a custom keyboard which is a service and I need to read obtained data via keyboard using this library I could only get data to the keyboard when the terminalfragment is open and read data on UI but I need data when the terminalfragment is onPause.

kai-morich commented 1 year ago

you need a background service as used here

uniqueram commented 1 year ago

does this application not working in android version 13+?

kai-morich commented 1 year ago

did you try the background service? did do you observe a specific issue on android 13+?

uniqueram commented 1 year ago

yes, I did and worked on Android 11 but when I try on Android 13+ when data arrive from the serial device application crashes.

kai-morich commented 1 year ago

what kind of crash do you get? same as issue #494?

uniqueram commented 1 year ago

I don't think the issue is like #494 I have tried that solution everything is working only when Data arrives from the serial device it gets crashed.

kai-morich commented 1 year ago

what kind of crash do you get?