ZebraPrinterLinkOs fails to Wrap printer object in my Android app

I am working with an iMZ320 printer using ZPL language. For some reason when I try to create a wrap for my printer object - ZebraPrinterLinkOs linkOsPrinter = ZebraPrinterFactory.createLinkOsPrinter(printer); - it fails and stops my application unexpectedly. Without using the wrapper my application works fine.

 

BTW, I tried the ConnectAndPrint Sample and the ZebraPrinterLinkOs instruction to create the wrapper works fine.

 

Hope somebody can guide me in the right direction.

 

Juan Carlos

Anonymous (not verified)
Hi Juan, Are you catching an

Hi Juan, Are you catching an exception?  I believe that command may throw several exceptions.  It would be helpful to know which one.  If not, is the linkOSPrinter object returning with == null?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Juan C. Hidalgo
Thank you Robin for you reply

Thank you Robin for you reply.

I have a try-catch-finally routine but it is not getting the ConnectionException which is the one that the ZebraPrinterFactory,createLinkOsPrinter throws. Instead, it jumps directly to the 'finally' branch.

printer: ZebraPrinterZpl@xxxxxx

linkOsPrinter: Cannot find local variable

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Juan, I'm assuming you are

Hi Juan,

I'm assuming you are checking that the connection is open before calling this factory function and the printer itself is set to ZPL if your app works fine without it.  You also tested the ConnectAndPrint Sample with the same printer, so the issue is less likely an issue with the printer.

Have you verified you have full two-way communication?  Can you request status?

I don't suppose you can post a code snippet showing exactly how you are setting up the iConnection and ZebraPrinter objects?  You seemed to have covered all the common issues.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi, Another quick question. 

Hi, Another quick question.  What firmware version is it currently running?

To find out, send "~WC" without quotes to get a printed configuration report.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Juan C. Hidalgo
V73.19.15Z

V73.19.15Z

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments