1

I'm currently developing an application with the Zebra Android SDK and facing a challenge in determining when a print job has completed on a Zebra printer. I am using the latest version of the Zebra Android SDK.

I attempted to use the sendAndWaitForResponse method in conjunction with the ^HV ZPL command, hoping to receive a "finished" response or similar indication when the print job completes.

However, I didn't receive the expected response. The response was always empty or not indicative of the print job's completion. I suspect this might be due to the specifications of my printer, which operates based on the guidelines provided in Volume One of the ZPL manual. It's possible that the ^HV command or the way I'm using it isn't compatible or sufficient for detecting the end of a print job in my specific scenario.

3
  • Take a look at the ~HS command. You will have to poll the printer using the command. Its return values can be parsed to show current printer status. Specifically, the uuuuuuuu - labels remaining in batch field will go to zero when the label has been printed. You can also use ~HS to determine if it is "safe" to send a print job by inspecting the error flags like ribbon out, paper out, head up, etc. Commented Dec 4, 2023 at 21:06
  • I managed to make the HS command work, thanks for that. Now I have another question about the sendAndWaitForResponse method: what value should I pass for the terminator parameter? When I use "", the printer just waits until the defined timeout. Commented Dec 4, 2023 at 21:57
  • Unfortunately, the ~HS reply does not have a unique terminator, It is simply three lines of text, with each line prefixed with \x02 and ending with \x03\r\n. Not familiar with the android sdk, but can you send the command, then receive the three lines individually? Most network libraries have "sendline" and "recvline" style interfaces. Commented Dec 4, 2023 at 23:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.