LinePrinterSample
This sample application demonstrates printing from an Android computer to a Honeywell mobile printer using the LinePrinter API.
Included with the application is a printer_profiles.JSON file (in the “assets” subfolder) that provides standard printer commands and attributes for several Honeywell printer models running the ESC/P language: PR2, PR3, PB21, PB31, PB42, and PB51. You can find the corresponding printer entries defined under the “PRINTERS” section. In the first input field of the LinePrinterSample main screen, please specify the identifier of one of the printer entries. It is default to “PR2”.
In the second input field of the LinePrinterSample main screen, please enter the printer’s Bluetooth MAC address or scan the Bluetooth MAC address barcode on the back of the 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.
You may enter an optional text to be printed in the third input field.
You may also capture a signature to be printed. To capture a signature, press the Sign button on the LinePrinterSample main screen. It opens another screen for you to sign and save the signature. The signature will be saved in PNG format encoded in Base64. Note: When you sign in the signature box, press firmly on the screen so it can detect the movement and draw accordingly.
Press the Print button to print the receipt with the optional user input text and signature.
Runtime Requirements and Dependencies
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 “LinePrinterSample-release.apk”. When you build from Eclipse, the APK file name should be “LinePrinterSample.apk”.
adb install LinePrinterSample-release.apk