public class MobilePrinter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ALIGNMENT_CENTER
Align to the center while printing text, barcode, and bitmap.
|
static int |
ALIGNMENT_LEFT
Align to the left while printing text, barcode, and bitmap.
|
static int |
ALIGNMENT_RIGHT
Align to the right while printing text, barcode, and bitmap.
|
static int |
AUTO_STATUS_AUTO_RECOVERABLE_ERROR
There is error in automatic recovery function.
|
static int |
AUTO_STATUS_COVER_OPEN
Printer cover is open.
|
static int |
AUTO_STATUS_NO_PAPER
No paper.
|
static int |
AUTO_STATUS_OFF_LINE
Turn off automatic status check function.
|
static int |
AUTO_STATUS_PAPER_FED
Feed button is depressed and paper is being fed.
|
static int |
AUTO_STATUS_UNRECOVERABLE_ERROR
There is unrecoverable error.
|
static int |
BAR_CODE_CODABAR
Set Codabar barcode type.
|
static int |
BAR_CODE_CODE128
Set Code128 barcode type.
|
static int |
BAR_CODE_CODE39
Set Code39 barcode type.
|
static int |
BAR_CODE_CODE93
Set Code93 barcode type.
|
static int |
BAR_CODE_EAN13
Set EAN13 barcode type.
|
static int |
BAR_CODE_EAN8
Set EAN8 barcode type.
|
static int |
BAR_CODE_ITF
Set ITF barcode type.
|
static int |
BAR_CODE_UPC_A
Set UPC-A barcode type.
|
static int |
BAR_CODE_UPC_E
Set UPC-E barcode type.
|
static int |
BITMAP_WIDTH_FULL
Set image width to the width of paper.
|
static int |
BITMAP_WIDTH_NONE
Set the image width constant.
|
static byte |
CODE_PAGE_1251_CYRILLIC
Set Windows-1251(Cyrillic) code page.
|
static byte |
CODE_PAGE_1252_LATIN1
Set Windows-1252(Latin 1) code page.
|
static byte |
CODE_PAGE_1253_GREEK
Set Windows-1253(Greek) code page.
|
static byte |
CODE_PAGE_1254_TURKISH
Set Windows-1254(Turkish) code page.
|
static byte |
CODE_PAGE_1255_HEBREW_NEW_CODE
Set Windows-1255(Hebrew new code) code page.
|
static byte |
CODE_PAGE_1256_ARABIC
Set Windows-1256(Arabic) code page.
|
static byte |
CODE_PAGE_1257_BALTIC
Set Windows-1257(Baltic) code page.
|
static byte |
CODE_PAGE_1258_VIETNAM
Set Windows-1258(Vietnam) code page.
|
static byte |
CODE_PAGE_437_THAI14
Set Thai14 code page.
|
static byte |
CODE_PAGE_437_USA
Set CP437(USA, Standard Europe) code page.
|
static byte |
CODE_PAGE_737_GREEK
Set CP737(Greek) code page.
|
static byte |
CODE_PAGE_775_BALTIC
Set CP775(Baltic) code page.
|
static byte |
CODE_PAGE_850_MULTILINGUAL
Set CP850(Multilingual) code page.
|
static byte |
CODE_PAGE_852_LATIN2
Set CP852(Latin 2) code page.
|
static byte |
CODE_PAGE_855_CYRILLIC
Set CP855(Cyrillic) code page.
|
static byte |
CODE_PAGE_857_TURKISH
Set CP857(Turkish) code page.
|
static byte |
CODE_PAGE_858_EURO
Set CP858(Euro) code page.
|
static byte |
CODE_PAGE_860_PORTUGUESE
Set CP860(Portuguese) code page.
|
static byte |
CODE_PAGE_862_HEBREW_DOS_CODE
Set CP862(Hebrew DOS code) code page.
|
static byte |
CODE_PAGE_863_CANADIAN_FRENCH
Set CP863(Canadian-French) code page.
|
static byte |
CODE_PAGE_864_ARABIC
Set CP864(Arabic) code page.
|
static byte |
CODE_PAGE_865_NORDIC
Set CP865(Nordic) code page.
|
static byte |
CODE_PAGE_866_CYRILLIC2
Set CP866(Cyrillic #2) code page.
|
static byte |
CODE_PAGE_928_GREEK
Set CP928(Greek) code page.
|
static byte |
CODE_PAGE_FARSI
Set Farsi code page.
|
static byte |
CODE_PAGE_KATAKANA
Set Katakana code page.
|
static byte |
CODE_PAGE_KHMER_CAMBODIA
Set Khmer(Cambodia) code page.
|
static byte |
CODE_PAGE_THAI11
Set Thai11 code page.
|
static byte |
CODE_PAGE_THAI16
Set Thai16 code page.
|
static byte |
CODE_PAGE_THAI18
Set Thai18 code page.
|
static byte |
CODE_PAGE_THAI42
Set Thai42 code page.
|
static boolean |
D |
static java.lang.String |
DEVICE_NAME
Key to return the device name for Bundle data included in the MESSAGE_DEVICE_NAME message.
|
static int |
DIRECTION_BOTTOM_TO_TOP
Print from bottom to top.
|
static int |
DIRECTION_LEFT_TO_RIGHT
Print from left to right.
|
static int |
DIRECTION_RIGHT_TO_LEFT
Print from right to left.
|
static int |
DIRECTION_TOP_TO_BOTTOM
Print from top to bottom.
|
static java.lang.String |
EXECUTE_DIRECT_IO
Key to return response in Byte array type in the Bundle data including the message while processing PROCESS_EXECUTE_DIRECT_IO.
|
static int |
HRI_CHARACTER_NOT_PRINTED
Barcode data text not printed.
|
static int |
HRI_CHARACTERS_ABOVE_AND_BELOW_BAR_CODE
Print barcode data text above and below the barcode.
|
static int |
HRI_CHARACTERS_ABOVE_BAR_CODE
Print barcode data text above the barcode.
|
static int |
HRI_CHARACTERS_BELOW_BAR_CODE
Print barcode data text below the barcode.
|
static int |
MAXI_CODE_MODE2
MAXICODE mode 2.
|
static int |
MAXI_CODE_MODE3
MAXICODE mode 3.
|
static int |
MAXI_CODE_MODE4
MAXICODE mode 4.
|
static int |
MESSAGE_DEVICE_NAME
Message for name of connected devices.
|
static int |
MESSAGE_DEVICE_SET
Message for list of paired Bluetooth devices.
|
static int |
MESSAGE_LOG |
static int |
MESSAGE_PRINT_COMPLETE
Message for completion of printing.
|
static int |
MESSAGE_READ
Message for printer response.
|
static int |
MESSAGE_STATE_CHANGE
Message for connected state.
|
static int |
MESSAGE_TOAST
Message for Toast.
|
static int |
MESSAGE_WRITE
Message for completion of command transmission.
|
static int |
MSR_MODE_NOT_USED |
static int |
MSR_MODE_TRACK1_AUTO |
static int |
MSR_MODE_TRACK12_AUTO |
static int |
MSR_MODE_TRACK123_AUTO |
static int |
MSR_MODE_TRACK123_COMMAND |
static int |
MSR_MODE_TRACK2_AUTO |
static int |
MSR_MODE_TRACK23_AUTO |
static int |
MSR_MODE_TRACK3_AUTO |
static java.lang.String |
MSR_TRACK1 |
static java.lang.String |
MSR_TRACK2 |
static java.lang.String |
MSR_TRACK3 |
static java.lang.String |
NV_IMAGE_KEY_CODES
Key to return the device name for Bundle data included in the message while processing PROCESS_GET_NV_IMAGE_KEY_CODES.
|
static int |
PRINTER_ID_CODE_PAGE
Currently configured printer code page.
|
static int |
PRINTER_ID_FEATURE_ID
Printing method and printer size ID.
|
static int |
PRINTER_ID_FIRMWARE_VERSION
Firmware version.
|
static int |
PRINTER_ID_MANUFACTURER
Manufacturer.
|
static int |
PRINTER_ID_MODEL_ID
Printer model ID.
|
static int |
PRINTER_ID_PRINTER_MODEL
Printer model.
|
static int |
PRINTER_ID_TYPE_ID
Printer type ID.
|
static int |
PROCESS_AUTO_STATUS_BACK
Response to automatic status check.
|
static int |
PROCESS_CONNECTED |
static int |
PROCESS_DEFINE_NV_IMAGE
Response to defineNvImage(Bitmap, int, int, int) and defineNvImage(Bitmap, int, int, int).
|
static int |
PROCESS_EXECUTE_DIRECT_IO
Response to executeDirectIo(byte[], boolean).
|
static int |
PROCESS_GET_BATTERY_STATUS
Response to getBatteryStatus().
|
static int |
PROCESS_GET_MSR_ENCRYPTION
Response to getMsrEncryption().
|
static int |
PROCESS_GET_MSR_MODE
Response to getMsrMode().
|
static int |
PROCESS_GET_NV_IMAGE_KEY_CODES
Response to getDefinedNvImageKeyCodes().
|
static int |
PROCESS_GET_PRINTER_ID
Response to getPrinterId(int).
|
static int |
PROCESS_GET_SENTINEL_CHARACTER1 |
static int |
PROCESS_GET_SENTINEL_CHARACTER2 |
static int |
PROCESS_GET_SENTINEL_CHARACTER3 |
static int |
PROCESS_GET_STATUS
Response to getStatus().
|
static int |
PROCESS_GET_STATUS1 |
static int |
PROCESS_GET_STATUS2 |
static int |
PROCESS_MSR_TRACK
Response of MSR data.
|
static int |
PROCESS_NONE |
static int |
PROCESS_PRIVATE_GET_MSR_ENCRYPTION |
static int |
PROCESS_REMOVE_NV_IMAGE
Response to removeNvImage(int) and removeAllNvImage().
|
static int |
PROCESS_RESPONSE |
static int |
PROCESS_SET_MSR_ENCRYPTION
Response to getMsrEncryption().
|
static int |
PROCESS_UPDATE_FIRMWARE
Response to updateFirmware(String).
|
static int |
QR_CODE_MODEL1
QR code model 1.
|
static int |
QR_CODE_MODEL2
QR code model 2 2.
|
static int |
STATE_CONNECTED
Printer is connected.
|
static int |
STATE_CONNECTING
Printer is connecting.
|
static int |
STATE_NONE
Printer is not connected.
|
static int |
STATUS_BATTERY_FULL
The status of battery is full.
|
static int |
STATUS_BATTERY_HIGH
The status of battery is high.
|
static int |
STATUS_BATTERY_LOW
The status of battery is low.
|
static int |
STATUS_BATTERY_MIDDLE
The status of battery is middle.
|
static int |
STATUS_COVER_OPEN
Printer cover is open.
|
static int |
STATUS_ERROR_OCCURRED
There is an error in the printer.
|
static int |
STATUS_NORMAL
Printer is normal.
|
static int |
STATUS_PAPER_FED
Feed button is depressed and paper is being fed.
|
static int |
STATUS_PAPER_NEAR_END
Printer paper is almost out.
|
static int |
STATUS_PAPER_NOT_PRESENT
There is no paper.
|
static int |
STATUS_PRINTING_STOPPED
Printing is stopped.
|
static java.lang.String |
TAG |
static int |
TEXT_ATTRIBUTE_EMPHASIZED
Set bold text.
|
static int |
TEXT_ATTRIBUTE_FONT_A
Set font A(12x24).
|
static int |
TEXT_ATTRIBUTE_FONT_B
Set font B(9x17).
|
static int |
TEXT_ATTRIBUTE_FONT_C
Set font C(9x24).
|
static int |
TEXT_ATTRIBUTE_REVERSE
Set shadow text.
|
static int |
TEXT_ATTRIBUTE_UNDERLINE1
Set 1 dot underline.
|
static int |
TEXT_ATTRIBUTE_UNDERLINE2
Set 2 dot underline.
|
static int |
TEXT_SIZE_HORIZONTAL1
Set 1 time magnification of text in horizontal direction.
|
static int |
TEXT_SIZE_HORIZONTAL2
Set 2 times magnification of text in horizontal direction.
|
static int |
TEXT_SIZE_HORIZONTAL3
Set 3 times magnification of text in horizontal direction.
|
static int |
TEXT_SIZE_HORIZONTAL4
Set 4 times magnification of text in horizontal direction.
|
static int |
TEXT_SIZE_HORIZONTAL5
Set 5 times magnification of text in horizontal direction.
|
static int |
TEXT_SIZE_HORIZONTAL6
Set 6 times magnification of text in horizontal direction.
|
static int |
TEXT_SIZE_HORIZONTAL7
Set 7 times magnification of text in horizontal direction.
|
static int |
TEXT_SIZE_HORIZONTAL8
Set 8 times magnification of text in horizontal direction.
|
static int |
TEXT_SIZE_VERTICAL1
Set 1 time magnification of text in vertical direction.
|
static int |
TEXT_SIZE_VERTICAL2
Set 2 times magnification of text in vertical direction.
|
static int |
TEXT_SIZE_VERTICAL3
Set 3 times magnification of text in vertical direction.
|
static int |
TEXT_SIZE_VERTICAL4
Set 4 times magnification of text in vertical direction.
|
static int |
TEXT_SIZE_VERTICAL5
Set 5 times magnification of text in vertical direction.
|
static int |
TEXT_SIZE_VERTICAL6
Set 6 times magnification of text in vertical direction.
|
static int |
TEXT_SIZE_VERTICAL7
Set 7 times magnification of text in vertical direction.
|
static int |
TEXT_SIZE_VERTICAL8
Set 8 times magnification of text in vertical direction.
|
static java.lang.String |
TOAST
Key to return the device name for Bundle data included in the MESSAGE_TOAST message.
|
Constructor and Description |
---|
MobilePrinter(android.content.Context context,
android.os.Handler handler,
android.os.Looper looper)
Create MobilePrinter instance.
|
Modifier and Type | Method and Description |
---|---|
void |
automateStatusBack(boolean isEnable)
Activate or deactivate automatic status check.
|
void |
cancelMsrReaderMode()
Cancel MSR reader mode.
|
void |
clearMsrData()
Clear previous MSR data.
|
void |
connect()
Establish USB connection to printer.
|
void |
connect(java.lang.String address)
Establish Bluetooth connection with the printer.
|
void |
connect(java.lang.String host,
int port,
int timeout)
Try wireless LAN connection with printer.
|
byte[] |
decryptTrackData(byte[] trackData)
Decrypt the encrypted track data.
|
void |
defineNvImage(android.graphics.Bitmap bitmap,
int width,
int level,
int keyCode)
Save Bitmap file of android.graphics.Bitmap type in non-volatile memory.
|
void |
defineNvImage(java.lang.String pathName,
int width,
int level,
int keyCode)
Save Bitmap file in PNG, JPG, BMP or GIF format in non-volatile memory.
|
void |
disconnect()
Clear the connection with printer.
|
void |
executeAutomaticCalibration()
Execute automatic calibration in label mode.
|
void |
executeDirectIo(byte[] command,
boolean hasResponse)
Set commands directly to printer.
|
void |
findBluetoothPrinters()
Search the currently paired Bluetooth printer.
|
void |
formFeed(boolean getResponse)
Execute form feed in the page mode.
|
void |
getBatteryStatus()
Return battery status.
|
void |
getDefinedNvImageKeyCodes()
Return the list of address code of the bitmap data saved in the non-volatile memory of the printer.
|
void |
getMsrEncryption()
Get whether MSR data is encrypted or not.
|
void |
getMsrMode()
Get the MSR setting value.
|
void |
getPrinterId(int idType)
Return printer ID information.
|
void |
getStatus()
Check printer status.
|
void |
initialize()
Cancel the value set in the printer and set the values power on initial values.
|
void |
lineFeed(int lines,
boolean getResponse)
Feed printer paper.
|
void |
print1dBarcode(java.lang.String data,
int barCodeSystem,
int alignment,
int width,
int height,
int characterPosition,
boolean getResponse)
Print 1-dimensional barcode
|
void |
printBitmap(android.graphics.Bitmap bitmap,
int alignment,
int width,
int level,
boolean getResponse)
Bitmap of android.graphics.Bitmap type is printed.
|
void |
printBitmap(java.lang.String pathName,
int alignment,
int width,
int level,
boolean getResponse)
Bitmap files in PNG, JPG, BMP or GIF format is printed.
|
void |
printDataMatrix(java.lang.String data,
int alignment,
int size,
boolean getResponse)
Print Data Matrix.
|
void |
printDotMatrixBitmap(android.graphics.Bitmap bitmap,
int alignment,
int width,
int level,
boolean getResponse)
Print Bitmap file of android.graphics.Bitmap type.
|
void |
printDotMatrixBitmap(java.lang.String pathName,
int alignment,
int width,
int level,
boolean getResponse)
Print Bitmap file in PNG, JPG, BMP, or GIF format.
|
void |
printMaxiCode(java.lang.String data,
int alignment,
int mode,
boolean getResponse)
Print MaxiCode.
|
void |
printNvImage(int keyCode,
boolean getResponse)
Print Bitmap saved in the non-volatile memory of the printer.
|
void |
printPdf417(java.lang.String data,
int alignment,
int width,
int height,
boolean getResponse)
Print PDF417.
|
void |
printQrCode(java.lang.String data,
int alignment,
int model,
int size,
boolean getResponse)
Print QR code.
|
void |
printText(java.lang.String text,
int alignment,
int attribute,
int size,
boolean getResponse)
Print character string.
|
void |
removeAllNvImage()
Remove all bitmap data saved in the non-volatile memory of the printer.
|
void |
removeNvImage(int keyCode)
Remove bitmap saved in the non-volatile memory of the printer.
|
void |
setAbsolutePrintPosition(int position)
Specifies the next print starting position in reference to the left edge of the print area.
|
void |
setAbsoluteVerticalPrintPosition(int position)
Sets the absolute vertical print starting position.
|
void |
setCodePage(int codePage)
Set single byte code page.
|
void |
setLabelMode()
Select label mode.
|
void |
setMsrEncryption(boolean isEncrypted)
Set whether MSR data would be encrypted.
|
void |
setMsrReaderMode()
Select card reader mode to 1/2/3 track card reader mode.
|
void |
setPageMode()
Printer is set to the page mode.
|
void |
setPrintArea(int x,
int y,
int width,
int height)
Set the print area in the page mode.
|
void |
setPrintDirection(int direction)
Set the print direction in the Page Mode.
|
void |
setReceiptMode()
Select receipt mode.
|
void |
setStandardMode()
Set to printer to the normal mode.
|
void |
updateFirmware(java.lang.String binaryFilePath)
Updates firmware of the printer.
|
public static final java.lang.String TAG
public static final boolean D
public static final int MESSAGE_STATE_CHANGE
public static final int MESSAGE_READ
public static final int MESSAGE_WRITE
public static final int MESSAGE_DEVICE_NAME
public static final int MESSAGE_TOAST
public static final int MESSAGE_LOG
public static final int MESSAGE_DEVICE_SET
public static final int MESSAGE_PRINT_COMPLETE
public static final int STATE_NONE
public static final int STATE_CONNECTING
public static final int STATE_CONNECTED
public static final java.lang.String DEVICE_NAME
public static final java.lang.String TOAST
public static final java.lang.String MSR_TRACK1
public static final java.lang.String MSR_TRACK2
public static final java.lang.String MSR_TRACK3
public static final java.lang.String NV_IMAGE_KEY_CODES
public static final java.lang.String EXECUTE_DIRECT_IO
public static final int ALIGNMENT_LEFT
printText(String, int, int, int, boolean)
,
print1dBarcode(String, int, int, int, int, int, boolean)
,
printBitmap(String, int, int, int, boolean)
,
printBitmap(Bitmap, int, int, int, boolean)
,
printPdf417(String, int, int, int, boolean)
,
printQrCode(String, int, int, int, boolean)
,
printMaxiCode(String, int, int, boolean)
,
printDataMatrix(String, int, int, boolean)
,
Constant Field Valuespublic static final int ALIGNMENT_CENTER
printText(String, int, int, int, boolean)
,
print1dBarcode(String, int, int, int, int, int, boolean)
,
printBitmap(String, int, int, int, boolean)
,
printBitmap(Bitmap, int, int, int, boolean)
,
printPdf417(String, int, int, int, boolean)
,
printQrCode(String, int, int, int, boolean)
,
printMaxiCode(String, int, int, boolean)
,
printDataMatrix(String, int, int, boolean)
,
Constant Field Valuespublic static final int ALIGNMENT_RIGHT
printText(String, int, int, int, boolean)
,
print1dBarcode(String, int, int, int, int, int, boolean)
,
printBitmap(String, int, int, int, boolean)
,
printBitmap(Bitmap, int, int, int, boolean)
,
printPdf417(String, int, int, int, boolean)
,
printQrCode(String, int, int, int, boolean)
,
printMaxiCode(String, int, int, boolean)
,
printDataMatrix(String, int, int, boolean)
,
Constant Field Valuespublic static final int TEXT_ATTRIBUTE_FONT_A
public static final int TEXT_ATTRIBUTE_FONT_B
public static final int TEXT_ATTRIBUTE_FONT_C
public static final int TEXT_ATTRIBUTE_UNDERLINE1
public static final int TEXT_ATTRIBUTE_UNDERLINE2
public static final int TEXT_ATTRIBUTE_EMPHASIZED
public static final int TEXT_ATTRIBUTE_REVERSE
public static final int TEXT_SIZE_HORIZONTAL1
public static final int TEXT_SIZE_HORIZONTAL2
public static final int TEXT_SIZE_HORIZONTAL3
public static final int TEXT_SIZE_HORIZONTAL4
public static final int TEXT_SIZE_HORIZONTAL5
public static final int TEXT_SIZE_HORIZONTAL6
public static final int TEXT_SIZE_HORIZONTAL7
public static final int TEXT_SIZE_HORIZONTAL8
public static final int TEXT_SIZE_VERTICAL1
public static final int TEXT_SIZE_VERTICAL2
public static final int TEXT_SIZE_VERTICAL3
public static final int TEXT_SIZE_VERTICAL4
public static final int TEXT_SIZE_VERTICAL5
public static final int TEXT_SIZE_VERTICAL6
public static final int TEXT_SIZE_VERTICAL7
public static final int TEXT_SIZE_VERTICAL8
public static final byte CODE_PAGE_437_USA
public static final byte CODE_PAGE_KATAKANA
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_850_MULTILINGUAL
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_860_PORTUGUESE
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_863_CANADIAN_FRENCH
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_865_NORDIC
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_1252_LATIN1
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_866_CYRILLIC2
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_852_LATIN2
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_858_EURO
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_862_HEBREW_DOS_CODE
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_864_ARABIC
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_THAI42
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_1253_GREEK
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_1254_TURKISH
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_1257_BALTIC
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_FARSI
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_1251_CYRILLIC
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_737_GREEK
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_775_BALTIC
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_437_THAI14
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_1255_HEBREW_NEW_CODE
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_THAI11
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_THAI18
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_855_CYRILLIC
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_857_TURKISH
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_928_GREEK
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_THAI16
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_1256_ARABIC
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_1258_VIETNAM
setCodePage(int)
,
Constant Field Valuespublic static final byte CODE_PAGE_KHMER_CAMBODIA
setCodePage(int)
,
Constant Field Valuespublic static final int BAR_CODE_UPC_A
public static final int BAR_CODE_UPC_E
public static final int BAR_CODE_EAN13
public static final int BAR_CODE_EAN8
public static final int BAR_CODE_CODE39
public static final int BAR_CODE_ITF
public static final int BAR_CODE_CODABAR
public static final int BAR_CODE_CODE93
public static final int BAR_CODE_CODE128
public static final int HRI_CHARACTER_NOT_PRINTED
public static final int HRI_CHARACTERS_ABOVE_BAR_CODE
public static final int HRI_CHARACTERS_BELOW_BAR_CODE
public static final int HRI_CHARACTERS_ABOVE_AND_BELOW_BAR_CODE
public static final int QR_CODE_MODEL1
public static final int QR_CODE_MODEL2
public static final int MAXI_CODE_MODE2
public static final int MAXI_CODE_MODE3
public static final int MAXI_CODE_MODE4
public static final int PRINTER_ID_MODEL_ID
getPrinterId(int)
,
Constant Field Valuespublic static final int PRINTER_ID_TYPE_ID
getPrinterId(int)
,
Constant Field Valuespublic static final int PRINTER_ID_FEATURE_ID
getPrinterId(int)
,
Constant Field Valuespublic static final int PRINTER_ID_FIRMWARE_VERSION
getPrinterId(int)
,
Constant Field Valuespublic static final int PRINTER_ID_MANUFACTURER
getPrinterId(int)
,
Constant Field Valuespublic static final int PRINTER_ID_PRINTER_MODEL
getPrinterId(int)
,
Constant Field Valuespublic static final int PRINTER_ID_CODE_PAGE
getPrinterId(int)
,
Constant Field Valuespublic static final int STATUS_NORMAL
getStatus()
,
Constant Field Valuespublic static final int STATUS_COVER_OPEN
getStatus()
,
Constant Field Valuespublic static final int STATUS_PAPER_FED
getStatus()
,
Constant Field Valuespublic static final int STATUS_PRINTING_STOPPED
getStatus()
,
Constant Field Valuespublic static final int STATUS_ERROR_OCCURRED
getStatus()
,
Constant Field Valuespublic static final int STATUS_PAPER_NEAR_END
getStatus()
,
Constant Field Valuespublic static final int STATUS_PAPER_NOT_PRESENT
getStatus()
,
Constant Field Valuespublic static final int STATUS_BATTERY_FULL
getBatteryStatus()
,
Constant Field Valuespublic static final int STATUS_BATTERY_HIGH
getBatteryStatus()
,
Constant Field Valuespublic static final int STATUS_BATTERY_MIDDLE
getBatteryStatus()
,
Constant Field Valuespublic static final int STATUS_BATTERY_LOW
getBatteryStatus()
,
Constant Field Valuespublic static final int BITMAP_WIDTH_FULL
public static final int BITMAP_WIDTH_NONE
public static final int AUTO_STATUS_OFF_LINE
public static final int AUTO_STATUS_COVER_OPEN
public static final int AUTO_STATUS_PAPER_FED
public static final int AUTO_STATUS_UNRECOVERABLE_ERROR
public static final int AUTO_STATUS_AUTO_RECOVERABLE_ERROR
public static final int AUTO_STATUS_NO_PAPER
public static final int DIRECTION_LEFT_TO_RIGHT
setPrintDirection(int)
,
Constant Field Valuespublic static final int DIRECTION_BOTTOM_TO_TOP
setPrintDirection(int)
,
Constant Field Valuespublic static final int DIRECTION_RIGHT_TO_LEFT
setPrintDirection(int)
,
Constant Field Valuespublic static final int DIRECTION_TOP_TO_BOTTOM
setPrintDirection(int)
,
Constant Field Valuespublic static final int MSR_MODE_TRACK123_COMMAND
public static final int MSR_MODE_TRACK1_AUTO
public static final int MSR_MODE_TRACK2_AUTO
public static final int MSR_MODE_TRACK3_AUTO
public static final int MSR_MODE_TRACK12_AUTO
public static final int MSR_MODE_TRACK23_AUTO
public static final int MSR_MODE_TRACK123_AUTO
public static final int MSR_MODE_NOT_USED
public static final int PROCESS_NONE
public static final int PROCESS_RESPONSE
public static final int PROCESS_GET_STATUS
public static final int PROCESS_GET_STATUS1
public static final int PROCESS_GET_STATUS2
public static final int PROCESS_GET_PRINTER_ID
public static final int PROCESS_AUTO_STATUS_BACK
public static final int PROCESS_EXECUTE_DIRECT_IO
public static final int PROCESS_GET_NV_IMAGE_KEY_CODES
public static final int PROCESS_DEFINE_NV_IMAGE
public static final int PROCESS_REMOVE_NV_IMAGE
public static final int PROCESS_UPDATE_FIRMWARE
public static final int PROCESS_CONNECTED
public static final int PROCESS_MSR_TRACK
public static final int PROCESS_GET_MSR_MODE
public static final int PROCESS_GET_BATTERY_STATUS
getBatteryStatus()
,
Constant Field Valuespublic static final int PROCESS_GET_MSR_ENCRYPTION
public static final int PROCESS_SET_MSR_ENCRYPTION
public static final int PROCESS_GET_SENTINEL_CHARACTER1
public static final int PROCESS_GET_SENTINEL_CHARACTER2
public static final int PROCESS_GET_SENTINEL_CHARACTER3
public static final int PROCESS_PRIVATE_GET_MSR_ENCRYPTION
public MobilePrinter(android.content.Context context, android.os.Handler handler, android.os.Looper looper)
context
- UI context to use the system service.handler
- UI Handler to receive message.looper
- Looper to execute threads in activity. Set to null if thread is not created.public void findBluetoothPrinters()
public void connect(java.lang.String address)
address
- MAC address of Bluetooth device. If it is null, it is connected to the first paired device.public void connect(java.lang.String host, int port, int timeout)
host
- Printer IP addressport
- Printer port (9100)timeout
- Timeout in milliseconds. Unlimited standby if this value is 0.public void connect()
public void disconnect()
public void getStatus()
public void getBatteryStatus()
public void initialize()
public void executeDirectIo(byte[] command, boolean hasResponse)
command
- Byte array type command to be sent to the printer.hasResponse
- Option whether to receive response from printer.public void printText(java.lang.String text, int alignment, int attribute, int size, boolean getResponse)
text
- Character string to print.alignment
- Alignment direction of character string to print.attribute
- Attribute of character string to print.size
- Size of the character string to print.getResponse
- Option whether to receive print complete message.setCodePage(int)
public void print1dBarcode(java.lang.String data, int barCodeSystem, int alignment, int width, int height, int characterPosition, boolean getResponse)
data
- Barcode data to print.barCodeSystem
- System type of barcode to print.alignment
- Alignment direction of barcode to print.width
- Width of barcode to print. (2 ~ 6)height
- Height of barcode to print. (1 ~ 255)characterPosition
- Print point of barcode data character string.getResponse
- Option whether to receive print complete message.public void printPdf417(java.lang.String data, int alignment, int width, int height, boolean getResponse)
data
- Data to print as PDF417.alignment
- Alignment direction of PDF417 to print.width
- Width of printed PDF417. (2 ~ 3)height
- Height of printed PDS417. (2 ~ 8)getResponse
- Option whether to receive print complete message.public void printQrCode(java.lang.String data, int alignment, int model, int size, boolean getResponse)
alignment
- Alignment direction of QR code to print.data
- Data to print as QR code.model
- QR code modelsize
- Size of QR code to print. (1 ~ 8)getResponse
- Option whether to receive print complete message.public void printMaxiCode(java.lang.String data, int alignment, int mode, boolean getResponse)
data
- Data to print as MaxiCode.alignment
- Alignment direction of Maxicode to print.mode
- MaxiCode mode.getResponse
- Option whether to receive print complete message.public void printDataMatrix(java.lang.String data, int alignment, int size, boolean getResponse)
data
- Data to print as Data Matrix.alignment
- Alignment direction of Data Matrix to print.size
- Size of Data Matrix to print. (2 ~ 3)getResponse
- Option whether to receive print complete message.public void lineFeed(int lines, boolean getResponse)
lines
- Number of lines to feed.getResponse
- Option whether to receive print complete message.public void printBitmap(java.lang.String pathName, int alignment, int width, int level, boolean getResponse)
pathName
- Absolute path of the bitmap file to print.alignment
- Alignment direction of bitmap file to print.width
- Width of bitmap to print.level
- Print darkness(13 ~ 88). To use auto-leveling, level + 10000getResponse
- Option whether to receive print complete message.public void printBitmap(android.graphics.Bitmap bitmap, int alignment, int width, int level, boolean getResponse)
bitmap
- Bitmap instance to print.alignment
- Alignment direction of bitmap file to print.width
- Width of bitmap to print.level
- Print darkness(13 ~ 88). To use auto-leveling, level + 10000getResponse
- Option whether to receive print complete message.public void printDotMatrixBitmap(java.lang.String pathName, int alignment, int width, int level, boolean getResponse)
pathName
- Absolute path of the bitmap file to printalignment
- Alignment direction of bitmap file to print.width
- Width of bitmap to print.level
- Print darkness(13 ~ 88). To use auto-leveling, level + 10000getResponse
- Option whether to receive print complete message.public void printDotMatrixBitmap(android.graphics.Bitmap bitmap, int alignment, int width, int level, boolean getResponse)
bitmap
- Bitmap instance to print.alignment
- Alignment direction of bitmap file to print.width
- Width of bitmap to print.level
- Print darkness(13 ~ 88). To use auto-leveling, level + 10000getResponse
- Option whether to receive print complete message.public void defineNvImage(java.lang.String pathName, int width, int level, int keyCode)
pathName
- Absolute path of the bitmap file to save.width
- Width of bitmap to print.level
- Print darkness(13 ~ 88). To use auto-leveling, level + 10000keyCode
- Address code to save.public void defineNvImage(android.graphics.Bitmap bitmap, int width, int level, int keyCode)
bitmap
- Bitmap instance to save.width
- Width of bitmap to print.level
- Print darkness(13 ~ 88). To use auto-leveling, level + 10000keyCode
- Address code to save.public void printNvImage(int keyCode, boolean getResponse)
keyCode
- Address code of the bitmap to print.getResponse
- Option whether to receive print complete message.public void removeNvImage(int keyCode)
keyCode
- Address code of the bitmap to remove.public void removeAllNvImage()
public void getDefinedNvImageKeyCodes()
public void setCodePage(int codePage)
codePage
- Code page to set.public void getPrinterId(int idType)
idType
- ID type to be returned.public void automateStatusBack(boolean isEnable)
isEnable
- Automatic status check is activated when it is true and deactivated when it is false.AUTO_STATUS_OFF_LINE
,
AUTO_STATUS_COVER_OPEN
,
AUTO_STATUS_PAPER_FED
,
AUTO_STATUS_UNRECOVERABLE_ERROR
,
AUTO_STATUS_AUTO_RECOVERABLE_ERROR
,
AUTO_STATUS_NO_PAPER
public void formFeed(boolean getResponse)
getResponse
- Option whether to receive print complete message.setPageMode()
,
setPrintArea(int, int, int, int)
,
setPrintDirection(int)
public void setPageMode()
public void setStandardMode()
public void setPrintArea(int x, int y, int width, int height)
x
- Starting point in horizontal direction.y
- Starting point in vertical direction.width
- Width of the print area to set.height
- Height of the print area to set.setPageMode()
,
setPrintDirection(int)
public void setPrintDirection(int direction)
direction
- Direction to printsetPageMode()
public void setAbsolutePrintPosition(int position)
position
- Print position.public void setAbsoluteVerticalPrintPosition(int position)
position
- Vertical print positionpublic void setMsrReaderMode()
public void cancelMsrReaderMode()
public void getMsrMode()
public void getMsrEncryption()
public void setMsrEncryption(boolean isEncrypted)
isEncrypted
- If true, MSR data will be encrypted. Otherwise MSR data will not be encrypted.public void clearMsrData()
public byte[] decryptTrackData(byte[] trackData)
trackData
- Encrypted track data.public void setLabelMode()
public void setReceiptMode()
public void executeAutomaticCalibration()
public void updateFirmware(java.lang.String binaryFilePath)
binaryFilePath
- Absolute path of the firmware binary file.