User Manual
Back-Clip Print-Scan All in One Device
9.SDK
Class “PrinterInstance” provides the following method:
a) //use BluetoothDevice
PrinterInstance(Context context, BluetoothDevice bluetoothDevice, Handler
handler)
b) //use UsbDevice
PrinterInstance(Context context, UsbDevice usbDevice, Handler handler)
c) //use wifi address and port number
PrinterInstance(String ipAddress, int portNumber, Handler handler)
Handler: use for receive connect state change. Use constant value:
PrinterConstants.Connect.SUCCESS;
PrinterConstants.Connect.FAILED;
PrinterConstants.Connect.CLOSED;
2. Open and close connection:
a) openConnection() open connection.
b) closeConnection() close connection.
3. Common method:
a) Init printer.
init()
b) Print common text.
printText(String content)
c) Send byte data.
sendByteData(byte[] content)\
user can use this method send command to printer if the SDK don’t
provide the
method in printer development document, such as:
byte[] command = new byte[3];
command[0] = 0x1B;
command[1] = 0x31;
command[2] = 49;
sendByteData (command);
d) Print image.
bitmap is image ;left is left margin;multiple is stylus printer multiple for
zoom in.
printImage(Bitmap bitmap);
printImage(String bitmap, int left);
printImage(Bitmap bitmap, int multiple);
printImage(String bitmap, int left, int multiple);
e) Print table. Use Table class set table data.
printTable(Table table)
f) Print barcode. Use Barcode class to set barcode data.
PrintBarCode(Barcode barcode)
14