We have developed several samples code in Android Studio that implemented Zebra’s best practices. Also, there is a blog that explains aspects regarding the importance of the selecting the proper printer language. I have added another link to a forum request which will help you with the font software question.
Most of the libraries in our LINK-OS SDK support similar classes in iOS and Android. Please, follow the links below where you can compare the structure of each API.
ZPL – Printing Language set up:
SGD.SET("device.languages", "zpl", connection);
SGD.SET("device.languages", "hybrid_xml_zpl", connection);
[SGD SET:"device.languages" withValue:@"zpl" andWithPrinterConnection:zebraPrinterConnection error:&error];
[SGD SET:"device.languages" withValue:@"hybrid_xml_zpl" andWithPrinterConnection:zebraPrinterConnection error:&error];
Check Printing language:
String printerLanguage = SGD.GET("device.languages",connection);
NSString *printerLanguage = [SGD GET:"device.languages" withPrinterConnection:zebraPrinterConnection error:&error];
Links to sample Code implementing Best practices in Printing Apps
Please, let us know if the information was useful and it answered your questions.
wow - that is a thorough answer, thank you. It looks like I have a ton of work ahead of me on this.
One question - should I set the device language during app initialization, or during each print command?
There are several uses cases where you can decide when to add this check point step in your development logic.
1.) App Initialization
2.) When the user pairs the printer for first time with the app during his work shift.
3.) If the printer is working with different users, and there is a login change with a new user in the app. It is recommended to verify and set up ZPL before to send print jobs.
4.) If the mobile device is using different apps with the printer, and these are using different printer languages like CPCL, Line_print. It is recommended to verify and set up ZPL before to send print jobs
Regarding your font question, I forgot to mention that the link associated in my previous reply is when the printer is configured to work in CPCL or Line_Print.
For ZPL, the API includes classes and methods that allow you to do downloading and conversion of different ZPL fonts.
You can use the following class and interface located in the com.zebra.sdk.printer package. Please, review the links for the API documentation of my previous reply.
Hi, I was trying to make bold characters and barcode. So I decided to change the mode to ZPL. but I couldnt
SGD.SET("device.languages", "zpl", conn);
ZebraPrinter zPrinterIns = ZebraPrinterFactory.getInstance(conn);
When I debugged it it say: SGD.GET("device.languages",conn) = "line_print"
Can u help me pls ?