Android Question Problem connecting to label printer XP-420B via Bluetooth

Lakhtin_V

Active Member
Licensed User
Longtime User
I am trying to print a picture on a printer. Using another application on my smartphone, I checked the work with this printer via Bluetooth. Everything works. I added permissions to the manifest. In my application, I successfully found out the MAC address of the printer. The search for Bluetooth devices is successful. But in my code, an error occurs at the stage of connecting to the printer. Connection to a specific MAC address does not occur, an error occurs. What could be the reasons?
.............Connected Device.Mac DD:0D:30:23:E6:5F Device.Name XP-420B
getBluetoothService() called with no BluetoothManagerCallback
java.io.IOException: read failed, socket might closed or timeout, read ret: -1
at android.bluetooth.BluetoothSocket.readAll(BluetoothSocket.java:738)
at android.bluetooth.BluetoothSocket.readInt(BluetoothSocket.java:750)
at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:375)
at anywheresoftware.b4a.objects.Serial$1.run(Serial.java:159)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:760)
........... trying to connect to printer
........... Failed to connect to printer!
BoostFramework() : mPerf = com.qualcomm.qti.Performance@fa6aad8
 
Top