I use a CITIZEN thermal printer as a Bluetooth device. and it works fine, except in the following situation,
- I pair the device.
- I connect to it by entering pin.
- Now i print something and immediately switch off the printer and now when i try to print something there no exception thrown and No error , Thus my all data is lost.
Is there a fix for this or is that a bug in android. i use datecs-java-bg-sdk as library file.
Thank for any help.
When a device is disconnected, for whatever reason, ACL_DISCONNECTED event is broadcasted, you have to register intent and listen for this broadcast in order to do something when your printer is switched off..
Another thing, if you are already sending and receiving data, when device is disconnected you are catching IOEXception, you can also write your code there, mostly checking with output stream, in write method