LabelPrinterSample

 

 

 

Sample Overview

 

This sample application demonstrates printing from an Android computer to a Honeywell mobile printer using the LabelPrinter API.

 

The sample project contains a printer_profiles.JSON file in the "assets" folder which defines standard settings to communicate with known Honeywell printers. The PRINTERS JSON object contains two printer entries for label printing, PB22_Fingerprint and PB32_Fingerprint. As the name implies, these printer settings are for the PB22 and PB32 printers respectively and the printer command language is Fingerprint. You may add other printer entries to the PRINTERS JSON object. Please refer to the User's Guide for more information.

 

This sample contains 3 activities. In the main activity, please specify either PB22_Fingerprint or PB32_Fingerprint in the Printer ID input field. The Bluetooth MAC Address field should contain the Bluetooth MAC Address of your printer. The MAC address text should have the format of “nn:nn:nn:nn:nn:nn” or “nnnnnnnnnnnn” where each n is a hex digit. The PB22_Fingerprint settings allow you to print 2" labels and the PB32_Fingerprint settings print 3" labels.

 

In the main activity, press the Print Item Label button to display the PrintItemLabelActivity. This activity allows you to print a label containing the item name text, the item number barcode and text.

 

In the main activity, press the Print URL Label button to display the PrintURLLabelActivity. This activity allows you to print a label containing the QRCode encoded URL and two text lines.

 

Both PrintItemLabelActivity and PrintURLLabelActivity open and close the printer connection per print. For real world applications, you may print multiple labels before closing the connection. Also to ensure the data is transmitted to the printer before the connection is closed, both PB22_Fingerprint and PB32_Fingerprint printer entries specify a PreCloseDelay setting in the printer_profiles.JSON file.

 

Runtime Requirements and Dependencies

 

 

 

Building the Sample

 

You may build the sample from Eclipse with ADT plug-in. First import the project into Eclipse and Eclipse will automatically build it whenever the code changes are saved. The build output will be in the “bin” subfolder. The sample includes a pre-built version of the APK called “LabelPrinterSample-release.apk”. When you build from Eclipse, the APK file name should be “LabelPrinterSample.apk”.

 

 

Running the Sample

adb install LabelPrinterSample-release.apk