I follow the Zebra Android Link_OS SDK sample code for printing a test mark on the ZQ510 via Bluetooth, but it will not print in ZPL format.
Here is the code that I run to print the label:
private void sendZplOverBluetooth(final String theBtMacAddress) { new Thread(new Runnable() { public void run() { try {
And here is the print result. (I ran it twice, so there are two test prints).
Then I read about how it could be in a different mode, because for some reason Zebra cannot detect its own corporate language. So I tried to get the settings and see the Android application. Using this example SDK Link-OS code again:
private static void displaySettings(Connection c) throws ConnectionException, ZebraPrinterLanguageUnknownException, SettingsException, ZebraIllegalArgumentException { ZebraPrinter genericPrinter = ZebraPrinterFactory.getInstance(c); ZebraPrinterLinkOs linkOsPrinter = ZebraPrinterFactory.createLinkOsPrinter(genericPrinter); if (linkOsPrinter != null) { System.out.println("Available Settings for myDevice"); Set<String> availableSettings = linkOsPrinter.getAvailableSettings(); for (String setting : availableSettings) { System.out.println(setting + ": Range = (" + linkOsPrinter.getSettingRange(setting) + ")"); } System.out.println("\nCurrent Setting Values for myDevice"); Map<String, String> allSettingValues = linkOsPrinter.getAllSettingValues(); for (String settingName : allSettingValues.keySet()) { System.out.println(settingName + ":" + allSettingValues.get(settingName)); } String darknessSettingId = "print.tone"; String newDarknessValue = "10.0"; if (availableSettings.contains(darknessSettingId) && linkOsPrinter.isSettingValid(darknessSettingId, newDarknessValue) && linkOsPrinter.isSettingReadOnly(darknessSettingId) == false) { linkOsPrinter.setSetting(darknessSettingId, newDarknessValue); } System.out.println("\nNew " + darknessSettingId + " Value = " + linkOsPrinter.getSettingValue(darknessSettingId)); } }
This time I get a SettingsException with the description Operation cannot be performed on raw channel with a printer set to line print mode
How can I print ZPL text using Mac and develop Android correctly? I read about using some Zebra Utility applications to change the mode, but it is available only for Windows and their Android application does not work.
Regardless, if someone had to use the application with the printer in the wrong mode, they would have to go through all this unnecessary setup, which would not be intuitive for anyone.
Thanks for the help and appreciate any feedback.
source share