LinePrinterSample

 

 

 

Sample Overview

 

This sample application demonstrates printing from an Android computer to an Intermec PR2 printer using the LinePrinter API. You may enter or scan the MAC address barcode on the back of a PR2 printer and click the Print button to print. The MAC Address text should have the format of “nn:nn:nn:nn:nn:nn” where each n is a hex digit.

 

Included with the application is a printer_profiles.JSON file (found in the “assets” subfolder) that provides support for several other Intermec printer models running the ESC/P language:  PR2, PR3, PB21, PB31, PB42, and PB51.  To use the sample with one of those other printer options, replace the “PR2” printer ID parameter in the LinePrinter class constructor (found in PrintActivity.java) and rebuild/redeploy the application.

 

Runtime Requirements and Dependencies

 

Intermec CN51 with Android OS.

Other non-Intermec Android computers may work if they meet the following requirements:

1.    The computer has an ARM based processor.

2.    The computer is equipped with a Bluetooth radio.

3.    The computer has Android 2.3.3 (Gingerbread) API level 10 or greater.

4.    LinePrintService-release.apk must be installed before running this sample. LinePrintService-release.apk is in the “intermec-android-printing-sdk\libs\armeabi” subfolder of the downloaded zip file.

 

This sample uses the LinePrinter class; therefore, it depends on LinePrinter.jar. A copy of LinePrinter.jar is included in the “libs” subfolder of the LinePrinterSample project folder. When you build the LinePrinterSample project, the contents of the LinePrinter.jar will be added to the LinePrinterSample’s APK file.

 

 

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 “LinePrinterSample-release.apk”. When you build from Eclipse, the APK file name should be “LinePrinterSample.apk”.

 

 

Running the Sample

adb install LinePrinterSample-release.apk