How to Use the Terminal's Bluetooth Printer Service: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
Bluetooth printing is a service what terminal, which get a connection with buletooth printer,sending data to the printer through the connection and then the printer data printing the data.And the connection is built by terminal with SPP(Serial Port Profile). | Bluetooth printing is a service what terminal, which get a connection with buletooth printer,sending data to the printer through the connection and then the printer data printing the data.And the connection is built by terminal with SPP(Serial Port Profile). | ||
The process of the service: | The process of the service: | ||
# open bluetooth if doesn't open | # open bluetooth if doesn't open | ||
example below: | |||
if (!mBluetoothAdapter.isEnabled()) { | |||
Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); | |||
startActivityForResult(enableIntent, REQUEST_ENABLE_BT); | |||
} | |||
# scan and discovery the bluetooth devices surrounding | # scan and discovery the bluetooth devices surrounding | ||
# select and pair the bluetooth printer | # select and pair the bluetooth printer | ||
# send data that is a series of ESC command | # send data that is a series of ESC command | ||
# printer print the data | # printer print the data |
Revision as of 02:53, 17 April 2018
Bluetooth printing is a service what terminal, which get a connection with buletooth printer,sending data to the printer through the connection and then the printer data printing the data.And the connection is built by terminal with SPP(Serial Port Profile). The process of the service:
- open bluetooth if doesn't open
example below:
if (!mBluetoothAdapter.isEnabled()) { Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); startActivityForResult(enableIntent, REQUEST_ENABLE_BT); }
- scan and discovery the bluetooth devices surrounding
- select and pair the bluetooth printer
- send data that is a series of ESC command
- printer print the data