Android Question BT mobile printer

ThePuiu

Active Member
Licensed User
Longtime User
I have a thermal mobile printer. It has BT and USB connectivity. I received an SDK file with the jar extension (attached file). I tried to copy it to the library folder but I can not find it in the library list ... Can someone help me with an idea of how I could use the entire set of commands of the printer? Simple printing works, but without barcodes, font sizes, etc.

Thank you
 

Attachments

  • RT_Android_Bluetooth_SDK_20150204.jar
    17.9 KB · Views: 357

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I have a thermal mobile printer. It has BT and USB connectivity. I received an SDK file with the jar extension (attached file). I tried to copy it to the library folder but I can not find it in the library list ... Can someone help me with an idea of how I could use the entire set of commands of the printer? Simple printing works, but without barcodes, font sizes, etc.

Thank you
is a printer that uses esc pos?
 
Upvote 0

ThePuiu

Active Member
Licensed User
Longtime User
in my documentation have:
package Name: com.RT_Printer.BluetoothPrinter.BLUETOOTH
The Method in Class BluetoothPrintDriver:
    • instantiation: BluetoothPrintDriver(this, mHandler);
    • open and close the connection method: connect(device); Establish a connection with a Bluetooth device
    • Begin(); Initialize the printer
    • public static void BT_Write (String dataString) Parameter: dataString:String data need to send

      etc

      I have included in my code:
      #AdditionalJar: RT_Android_Bluetooth_SDK_20150204


      B4X:
      Sub GetPrn As JavaObject
          Dim jo As JavaObject
          Return jo.InitializeStatic("com.RT_Printer.BluetoothPrinter.BLUETOOTH").RunMethod("with", Array(GetContext))
      End Sub

      when I call GetPrn.RunMethodJO("connect", Array("RPP300-E")) I get the error: java.lang.ClassNotFoundException: com$RT_Printer$BluetoothPrinter$BLUETOOTH



      I have never worked with JavaObject ...
 

Attachments

  • RT_Android_Bluetooth_SDK Development Document_V3.zip
    29.6 KB · Views: 464
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
@ThePuiu if the printer uses standard Epson ESC POS codes then you can just use the AsyncStreams library in conjunction with the Serial library to connect to and send data to the Bluetooth printer to print, no wrap or extra libraries needed.
 
Upvote 0

ThePuiu

Active Member
Licensed User
Longtime User
the printer supports serial commands but only prints ASCII characters. This wrapper is written in Java or B4A? Is there some documentation somewhere? In the limit of the time available I will learn to do so ... I have not yet come across something that I can not solve ... I only need a few hints to figure out where to start.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

colboy

Member
Licensed User
Longtime User
I've done exactly what are seeking, but using the printer as a serial device and sending down the correct codes. Doing this I create a label with a barcode and many lines of text. The printer I used was a Zebra ZQ500. The printer is able to usually work in 2 ways, 1 where the text you send it printed, great for plain text, but you then don't get access to the many printer features. For this you put the printer into another mode, where it is expecting ZPL commands. I imagine your printer has similar features. Happy to share some code if this is of interest, but you will first need to see what command language your printer supports.

Colin
 
Upvote 0

ThePuiu

Active Member
Licensed User
Longtime User
Hi Colin,
I'm interested in using different size and normal or bold fonts, and thinner horizontal lines (if is possible).
 
Upvote 0

colboy

Member
Licensed User
Longtime User
Hi Colin,
I'm interested in using different size and normal or bold fonts, and thinner horizontal lines (if is possible).
The printer seems to have 2 fonts and they both appear to be Chinese simplified, as per the manual, but I can't believe it can't do ASCII alphanumeric. Again, if I can see a label, or a sketch of a label you are trying to print, I can give you a little more guidance.

Colin
 
Upvote 0

colboy

Member
Licensed User
Longtime User
something like that (see attached image)
As a label that looks relatively straightforward. I would suggest aligning to the left if possible, otherwise you will need to calculate the position of right aligned items, based on text and size.

As I said, I've done this for Zebra printers via Bluetooth and while I haven't used your printer, based on the information in the manuals everything you want is available. Creating output is a little time intensive, but once you have a design that works, you can then forget about it.

Colin
 
Upvote 0

emexes

Expert
Licensed User
The Product Parameters tab of that printer model weblink you gave says "Printing Command: ESC/POS" which suggests it uses/emulates Epson printer control codes, for which there is much documentation, eg randomly-chosen:

https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=2

The Wikipedia page on ESC/P says:
ESC/POS is a variant for controlling receipt printers as commonly used at the point of sale (POS). An open source project listing almost all the ESC/POS compatible printers and their capabilities is available here.


I'm interested in using different size and normal or bold fonts, and thinner horizontal lines (if is possible).
It's been a decade since I last spoke printer control codes, so I'm a bit rusty on this, but according to that reference.epson page:

for bold text, try:
Name: Turn emphasized mode on/off

Format:
ASCII: ESC E n
Hex: 1B 45 n
Decimal: 27 69 n

When the LSB of n is 0, emphasized mode is turned off.
When the LSB of n is 1, emphasized mode is turned on.

and for different size text, magnified x2..8 in width and/or height, try:
Name: Select character size

Format:
ASCII: GS ! n
Hex: 1D 21 n
Decimal: 29 33 n

Description: Selects character size (height magnification and width magnification).
 
Upvote 0
Top