kai-morich / SimpleBluetoothTerminal

Android terminal app for Bluetooth classic devices using SPP profile
MIT License
447 stars 166 forks source link

Receive data when lock screen #19

Closed hominh closed 3 years ago

hominh commented 3 years ago

Hi. I am using your code. How to receive data when lock screen. Thanks you very much

kai-morich commented 3 years ago

Data is received by SerialService class while screen is locked or App is in minimized. When the App gets visible again, the TerminalFragment gets all accumulated data after service.attach(). If you want to process data while screen is locked or App is in minimized, you have to do this in a foreground service like SerialService.

hominh commented 3 years ago

Thanks you for reply. How to modify SerialService class to process data while screen is locked?

kai-morich commented 3 years ago

see onSerialRead method where listener == null