shangmisunmi / SunmiPrinterDemo

printer test demo
290 stars 140 forks source link

SunmiPrinterDemo

Please be sure to read the documentation when using Demo and You can find developer documentation from https://docs.sunmi.com

We strongly recommend developers to use Android Studio to develop.The demo for Android Studio has full functionality, such as printing barcodes, printing qr code, printing text, printing pictures and printing tables.

Library

dependencies{
  implementation 'com.sunmi:printerlibrary:1.0.18'
}

Now we replaced AIDL integration with Sunmi Printer Interface Library.
It is suitable for any Sunmi device.

AIDL

If you have to use AIDL to integrate projects, you can get AIDL resource from http://sunmi-ota.oss-cn-hangzhou.aliyuncs.com/DOC/resource/re_cn/AIDL%E6%96%87%E4%BB%B6/aidl.zip You can see simple use from Demo for Eclipse:https://github.com/shangmisunmi/SunmiPrinterDemo-Eclipse-  

Instruction

InnerPrinter Ble

Each function module can be used via Bluetooth, You can send the esc command through innerprinter ble.
See it in each module:

if (!BluetoothUtil.isBlueToothPrinter) {
    //Call API  
} else {
    //ESC cmd via Ble
}