1. Know your Bluetooth printer model
I’m dockingGabor PT260 Bluetooth printer, parameters are as follows:
Download the SDK
To connect to bluetooth printers of different brands, we need to download the SDK of corresponding brands, so I go toJia bo’s official websiteClick the technical advisory floating on the right
Switch to manual customer service, indicating that to connect to bluetooth printer, with the latest TECHNOLOGY TO the SDK
I have downloaded good, so you can go directly to my network backup download links: pan.baidu.com/s/1osbShTnZ… Extraction code: 84FG
3. View demo
To open the SDK sent to us by the technology, the following three files are needed to connect to the Bluetooth printer
To open GpsdkDemo with AS, you may need to modify the following two things to run the Demo
Compile. Gradle: compile
Click bluetooth connection, find the device that starts with “Printer_” and connect it to start the test
4. View demo source code and put it in your own project
5, pay attention to
Now the bluetooth printer of Jiabo is connected, so the SDK of Jiabo is used. If you want to do a general project and connect to all bluetooth printers, you can do without the SDK of Jiabo
Bluetooth scanning, pairing, connection, etc., are universal, specific can be developed through Android Bluetooth – classic Bluetooth detailed development process written in this article, through this article, can be correctly connected to the Bluetooth printer
As for printing, you can refer to the Article about Android Bluetooth connection to ESC/POS thermal printer printing (ESC/POS directive), and VitaminChen’s article also provides a Bluetooth printer demo, through which you can print receipts correctly