Bluetooth SDK User Guide PDF
Bluetooth SDK User Guide PDF
This SDK package is for Android application, communicate the printer with Bluetooth connections.
It can be divided into 2 main types. One is bluetooth operation Type and other for Image printing
and processing.
com.xx.btsdk
Type BluetoothService
java.lang.Object
com.xx.btsdk.BluetoothService
BluetoothService Type for Bluetooth operation ( e.g. Bluetooth connection, Bluetooth data
transmitting, Bluetooth device searching etc. )
com.xx.btsdk
Type PrintPic
java.lang.Object
com.xx.btsdk.PrintPic
PrintPic Type for image printing and processing (decompose the desired images into easily
recognizable data stream )
Schematic Diagram
Android application programming calls the corresponding interface from Bluetooth SDK
package( e.g. connecting the Bluetooth interface ), and meanwhile receiving the messages sent
back from the bluetooth SDKpackage( e.g. connecting failure notice).Android application
programming could calls the sending print function, and sending the printing command to
Bluetooth Printer in one-way.
Interface description
Constructed function
public BluetoothService(Context context, Handler handler)
Function description:
Initialization of class field
Parameter description:
Handler: Afferent a Hander instance, used for SDK package return the messages to android application
Programming.
Ordinary function
a. isAvailable
Function Prototype:public synchronized boolean isAvailable()
Function Description:
Judge and ensure the android device & Bluetooth hardware is usable.
Return value description:
True: Bluetooth available
False: Bluetooth not available
b.isBTopen
c.getDevByMac
d. sendMessage
f. getPairedDev
g. cancelDiscovery
Type PrintPic
Ordinary function
a. initCanvas
b. initPaint
c. drawImage
四.Demo Program
Please refer to PrintDemo for bluetooth printer for Detail( Demo program for this
SDK )
Development tool:Android Developer Tools(Build: v21.0.1-543035)