Android Tutorial BlueTooth Printing via SPP

I finally have reliable, stable printing to a blue tooth printer (Citizen CMP-10 and CMP-20) from my Samsung 5570L Galaxy Mini Android Device running v2.3.6

Attached is a skeleton project (based on the Serial example posted here) in Basic4Android v1.8 that requires the following libraries

Core v1.77
Serial v1.20
ToggleLibrary 1.00

It may work with other versions but this is what works for me in my specific situation


To print you must first pair the phone/device to the printer

In the program you must place what you wish to print in PrintBuffer (string) variable and call StartPrinter (sub)

If the printer is not turned on it returns an error message and allows you to reprint

Hope this helps someone :)

Tim
 

Attachments

  • BTPrint.zip
    8.7 KB · Views: 6,605
Last edited:

timwil

Active Member
Licensed User
Longtime User
Also confirmed working with Samsung Galaxy S2 and Datecs DPP-350
 

hdtvirl

Active Member
Licensed User
Longtime User
Timwil, I too can confirm that it also works with the Acer Iconia A500 and the Printek Mobile FieldPro RT43 4" BT Printer.

Thanks for sharing this code.

Regards

BOB
 

timwil

Active Member
Licensed User
Longtime User
Timwil, I too can confirm that it also works with the Acer Iconia A500 and the Printek Mobile FieldPro RT43 4" BT Printer.

Thanks for sharing this code.

Regards

BOB

You are very welcome

Others have helped me - just trying to give back :)
 

Theera

Well-Known Member
Licensed User
Longtime User
Where is ToggleLibrary 1.00?

Hi Timwil and All,
I need to download ToggleLibrary ,but I don't know that where it is. Please help me.
Best Regards
Theera

I finally have reliable, stable printing to a blue tooth printer (Citizen CMP-10 and CMP-20) from my Samsung 5570L Galaxy Mini Android Device running v2.3.6

Attached is a skeleton project (based on the Serial example posted here) in Basic4Android v1.8 that requires the following libraries

Core v1.77
Serial v1.20
ToggleLibrary 1.00

It may work with other versions but this is what works for me in my specific situation


To print you must first pair the phone/device to the printer

In the program you must place what you wish to print in PrintBuffer (string) variable and call StartPrinter (sub)

If the printer is not turned on it returns an error message and allows you to reprint

Hope this helps someone :)

Tim
 

timwil

Active Member
Licensed User
Longtime User
You do not actually NEED the Toggle Library but you would have to turn Bluetooth on manually if you do not. :)
 

Theera

Well-Known Member
Licensed User
Longtime User
How to use BTPrint.apk for test to learn?

You do not actually NEED the Toggle Library but you would have to turn Bluetooth on manually if you do not. :)

Hi Timwil,
I downloaded your BTPrint.zip file for my test. I need to learn it. after exacted BTPrint.zip ,and then test with emulator ,it has error occurred.

P.s. I 'm not good at English

Best Regards
Theera
:sign0098:
 
Last edited:

Inman

Well-Known Member
Licensed User
Longtime User
Thank you very much for this code module. Does this work with all bluetooth printers or does it need special bluetooth printers that are labelled "android compatible"?
 

timwil

Active Member
Licensed User
Longtime User
I am hoping that as people try it out they will report back what it works with. Also what it does not work with!

I personally have used it with the Citizen CMP-10 and CMP-20 - others have used two other printers and got them working.

As long as the printer is blue tooth and can be paired it should work.

NOTE: As you will be sending text directly to the printer you are responsible for any control codes! The printers that I have tried are Epson ESC/POS compatible and I have had no problems with them. If you are trying a printer and need some assistance I will do what I can to help.
 
Last edited:

Inman

Well-Known Member
Licensed User
Longtime User
Thanks Timwill.

Here are spec sheets of 3 models of bluetooth printers I am looking at

Specsheet

Some models mention about compatibility with Windows Mobile, Symbian, Blackberry etc.. but no mention of Android. Could you please take a look?
 

manios

Active Member
Licensed User
Longtime User
Hi Inman,

the datasheet are mention ESC/POS as emulation.
There are infomation about this emulation freely available. However you need additional info from the manufacturer about the coding for printing barcodes and some other specials.
For android you have to write a "driver" yourself. Depending an what you need to print, it is not very hard. Some text and a barcode is easy.
I have done this for a (big) Godex label-printer, but they have their own emulation which is documented very good.
 

Inman

Well-Known Member
Licensed User
Longtime User
Thanks guys. I checked the PDF file with POS commands and they look easy. I can hopefully get the printer by next month and start working.
 

timwil

Active Member
Licensed User
Longtime User
Good Luck!

If there is any assistance I can provide let me know.....
 

Theera

Well-Known Member
Licensed User
Longtime User
Is way to layout printing?

Hi all,
I see the source code ,I don't know that how to layout printing. I had used
foxpro for dos,it's use @row,col to fix layout.

Best Regards
Theera
 

timwil

Active Member
Licensed User
Longtime User
Hi Theera

What are you trying to do exactly?

I used dBase II and then Clipper for DOS - those were the good ole days! :)

Tim
 
Top