Do a complete buffer of your text before printing. Don't a line at a time. Print everthing once.Hello All,
My App prints (EscPOS Bluetooth printer) without errors or issues in Android 8 thru 10, but in Android 11 (Samsung Tab Active3) it can't print the whole ticket
It always stop half way, even with resets between the prints, and after it misprints, I cannot print anything else.
I have to disconnect, reconnect and then printer to be able to print another ticket.
Any ideas ?
Thanks
How so ?Do a complete buffer of your text before printing. Don't a line at a time. Print everthing once.
Make the string one. send the bitmap followed bybthe string.How so ?
Crate a string with the full content and then print the string ?
I have bitmaps also
Same result. In android 11 it doesn't print the second one all the wayMake the string one. send the bitmap followed bybthe string.
Thanks For Replay ... my problem is on printer. (Different model)I have solved it, by not complicating it.
I have several activies that can print, so I initialized and connected the EscPosPrinter object in the start of each, do all the printing required and disconnect the printer on exit (Activity.close)
That done it for me.
can you help me to solve this problem,please?I have solved it, by not complicating it.
I have several activies that can print, so I initialized and connected the EscPosPrinter object in the start of each, do all the printing required and disconnect the printer on exit (Activity.close)
That done it for me.
Care to elaborate ? Need help in exactly what ?can you help me to solve this problem,please?
in attach code of bluetooth and print activity what's the matter??? in android 11 print half of receiptCare to elaborate ? Need help in exactly what ?
Did you get a solution?Care to elaborate ? Need help in exactly what ?
For me nothing worked until I did the followingDid you get a solution?
Have you tried to do all the Printer-Communication from the Starterservice (or any other Service) and call the print-methods (in the service) from all activities then?until I did the following
the error apppear this messageFor me nothing worked until I did the following
Initialize the printer on each activity
Connect before every print job
disconnect after printing was complete
but I had to print from a multi activity App
Unfortunately, the problem is not with the printer, because it prints perfectly with all Android devices except Android 11You see an abruptly disconnection in Android with the error message "E/bt_btif_sock_rfcomm" and a half printed receipt. The printer has a limited internal memory buffer in which the printer data is temporarily stored. In this case, full = full. If the buffer is about to become full, the printer will send an XOFF command with the intention to directly stop receiving more incommoding data. If an OS is more efficient at processing the printer data, sending it faster, or Bluetooth than the printer can print, the printer's internal buffer becomes full.
When the buffer can receive data again, it sends an XON character. If your program does not stop sending printer data after an XOFF message, the printer will hang. Only what is in the buffer is still printed and the printer stops immediately (thats why you see a half receipt). If that is in the middle of a printer control command, my experience is that almost no printer survives this without a power off/on action (thats why you must hard reset the printer).
What I am missing in the program is checking whether the printer has an XOFF status message with the character Pause transmission code XOFF, ASCII codec DC3, 19 decimal or 13 Hexadecimal. The XON Resume transmission ASCII code is DC1, ASCII code 17 or 11 Hexadecimal. All this is missing from the program.
This so-called XON/XOFF printer handshake could of course be hidden in either the OS or the printer driver. Another possibility is that the XON/XOFF printer handshake is turned off in the printer setting because, for example, the printer setting is based on a serial or parallel interface hardware printer handshake.
My question is how the printer settings are. This can often be printed out by pressing the on/off line feed button or a reset button for some time when switching on the printer. See the user manual for the correct actions.
I use Android11 (and other android versions)Unfortunately, the problem is not with the printer, because it prints perfectly with all Android devices except Android 11
You should create a single string buffer and send it once to the printer instead of sending multiple single strings.If the issue is not in your printer maybe it is in your code.. better post a small example showing the issue
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?