9

I would like to print to a Bixolon SPP-R200 as I've heard, it's one of the easier mobile bluetooth printers to set up with android. However I am not sure how to get started.

  1. I guess first I'd have to connect to the printer via bluetooth - I assume for this purpose I resort to the native Android bluetooth API?

  2. I'd probably need some kind of SDK to send data to the printer - I read here, that there is an SDK, but browsing the bixolon page has not yielded any results (i.e. no SDK) - I wrote to support, but I am not expecting an answer any time soon...

I guess the other questions I'd have (like: Do you send bitmaps to the printer as you can do in .Net CF?) are tightly linked to an SDK for that printer - if it exists...

Community
  • 1
  • 1
AgentKnopf
  • 4,295
  • 7
  • 45
  • 81
  • I contacted Bixolon directly and they provided me with a special android SDK (didn't find this one on their website). I'll investigate and update my question accordingly. Meanwhile, if anyone is in need of the SDK just comment here. – AgentKnopf Jan 03 '12 at 16:09
  • Fun Fact: I am currently working through Bixolon's Sample project for Printing with the SPP-R200 and their method onContextItemSelected in BxlExample.java is 1700 lines long oO - I think I one time read about good practices, trying to not make methods longer than a screen length... And I think that could have been done easily in this case, as this monster-method is just a giant switch/case-statement... – AgentKnopf Jan 08 '12 at 16:43
  • Can you please provide me the SDK, please? – VSB May 14 '12 at 12:22
  • @VahhabSamadi I updated my Answer to include this download link to the Bixolon SDK : http://www.file-upload.net/download-4361748/bixolonSDK.zip.html – AgentKnopf May 15 '12 at 05:49
  • thanks. however have you implemented your project with SPP-R200 successfully? I'm going to buy one and i will be grateful if you share your experience about this device :) – VSB May 27 '12 at 17:11
  • @VahhabSamadi Jepp, Using the SDK and the Demo that comes with the SDK you should be easily able to print - no issues there. If you got specific questions do let me know. – AgentKnopf May 28 '12 at 08:08
  • it does works with .pdf? – desgraci Aug 17 '12 at 21:35
  • 1
    @desgraci Sorry for the late reply, you can check out the official spec here: http://www.bixolon.com/_eng/products/product_form.asp?code=0105&uid=34 but from what I see I assume it's not possible to print PDFs. I checked out the manuals from here http://www.bixolon.com/_eng/download_center/downloadsub.asp?uid=104&p_uid=38 and according to those PDF is not directly supported via the public API. – AgentKnopf Aug 28 '12 at 06:01
  • @Zainodis : recently i'm working on printing customer Invoice through Bluetooth from an Android device,i can connect and printText and Bitmap but the real issue is formatting it like putting PrintBitmap and PrintText next to eachother without linebreak or Drawing a Table. do you have any experience on drawing table? – Arash GM Nov 30 '14 at 06:54
  • @Arash What we're doing: Created our own printout definition XML structure, parse it, fill in the values from the domain model and translate it to drawing on a canvas. We basically draw on a canvas and print the resulting bitmap. So basically it's all an image and that makes drawing a bitmap onto that printout bitmap fairly easy. You just need to make sure to measure it and keep track of the pixels so you can align text to it's right etc. Let me know if you have a specific question. – AgentKnopf Nov 30 '14 at 11:53
  • @Zainodis : thank you very much for the response , so you are telling that for building a table , i have to draw my whole printing area (rows and columns)on a canvas , make a bitmap from that then print out that bitmap? – Arash GM Nov 30 '14 at 12:02
  • @Arash: If you really need a table with columns and row lines displayed then I'd recommend another approach: http://stackoverflow.com/questions/22323720/table-layout-to-bitmap You can convert an actual view (a TableLayout for instance) to a bitmap! So all you need to do, is create the TableLayout, fill it with data, grab the view, convert it to a bitmap, maybe scale it down and then print it. – AgentKnopf Nov 30 '14 at 12:15

2 Answers2

6

Okay, as it turned, out support was lightning fast and provided me with an Android SDK which answers the second question I had.

Said SDK comes with a a sample project as well as a user manual and an API of the SDK (Unfortunately the SDK jar file contains no javadoc...). I have to say the SDK API is ... poorly written and lacks depth, aside from that, some methods used in the sample project are not covered at all (such as "initialize" which I thought sounds rather important and mandatory...). However when looking at the sample you get an idea about how to use the SDK. It covers everything from connecting via Wifi, USB or bluetooth (which answers my first question).

If anyone is in need of the SDK/Sample Project, I suggest dropping the bixolon support guy's an email via techsupp@bixolon.de for receiving the most up-to-date SDK. I did NOT find the android SDK on Bixolon's website! The only SDK I found was .Net related.

UPDATE

On an Additional note: Turns out one does not really need the SDK. We dumped the SDK and instead, created two threads: One that accepts connection requests (to connect to the printer) and another one, which (once a connection has been established) has a BluetoothSocket and writes to it/reads from it. This has the advantage, that we can use it with any mobile printer, as it is not Bixolon-specific anymore.

For more Bluetooth-related infos check out this Q&A where I documented the steps to get the Bixolon (and Fujitsu) to communicate with android devices.

UPDATE 2

Since I passed by this post recently, and looked it up, here is some additional links for the Bixolon SPP-R200:

  • Downloads for Bixolon SPP-R200 (drivers, manuals, command manuals etc...)
  • Product Overview Bixolon SPP-R220
  • There is a Q&A section in Bixolon's website here. However you need to create an account first to see the answers in the Q&A section. If you type "android" in the search box a few answers pop up - however since I have no account, I did not read them - but it might be worth a shot
Community
  • 1
  • 1
AgentKnopf
  • 4,295
  • 7
  • 45
  • 81
  • Where did you find the `bixolonSDK.zip`. Where is its official website for probable updates? I have problem with Galaxy Tabs. Can you give me the link of the official page that this file is in it? – Bob Sep 29 '12 at 11:17
  • @breceivemail I updated my post to make it more clear: I got the SDK from Bixolons support (after contacting them) via Email, I did NOT find the Android SDK on their website. I removed the unofficial download links to the SDK I uploaded, since - and you have a point here - people should rather contact bixolon's support for the official SDK, as the one I uploaded might be outdated already. In the section "Update 2" I added some more information; maybe the SDK can be found by checking the answers in the Q&A section (requires account at bixolon's website). – AgentKnopf Oct 01 '12 at 05:55
  • Zainodis, could yo print images in these ESC/POS printer??... I have to print some images in a priter like these, but I don't know how... Could you help me?... [Check my question please](http://stackoverflow.com/questions/14530058/get-byte-data-of-a-bitmap-android) – Leonardo Sapuy Apr 30 '13 at 13:47
  • @LeonardoSapuy Yes, we're also printing images - in fact we only print images, as we render text onto a Canvas and then print it :) . I'll have a look at your question. – AgentKnopf May 01 '13 at 11:37
  • @Zainodis Hi, i download Bixolon android sdk from it's website. problem that m facing is not able to connect Android tablet with Bixolon SppR200 printer , it showing disconnect. please help. can you share your bixolon sdk ? It will help me a lot. – Brijesh Patel Nov 13 '14 at 09:04
  • @BrijeshPatel We no longer use the Bixolon SDK (hence I do no longer have it), instead we're using the Android Bluetooth API to connect to the Bixolon and print to it. As for your issue: Did u switch on Bluetooth on the tablet? If the printer is switched on an Bluetooth on the tablet is enabled, a scan on the tablet should find the printer and ask you to enter a pin (which I think is usually 0000 or 1234). After that (once you've paired both devices) you should be able to use the Bixolon SDK. Let me know in case you got further questions. – AgentKnopf Nov 14 '14 at 10:31
  • If anyone is looking for the download section of this printer, the link provided by @AgentKnopf is outdate, here is the new one http://www.bixolon.com/html/en/download/download_product.xhtml?prod_id=51 – Diomedes Domínguez Jul 15 '16 at 15:11
  • As of my knowledge if you set the target SDK of your app to 28 then your app will crash in Bluetooth communication. Please test this and if you find a solution post it here for every one. As far as I know there are some issues with the Android 9 Bluetooth which make some problem for printing to portable printers. – saeed khalafinejad Jun 05 '19 at 05:41
0

I've been working with this JAR (Dated 2014) that may be help. However, it is possible that the easier solution could be sending ESC sequences via the bluetooth serial port. So, in this point if your are creating a Phonegap App, you can use from this Plugin the Chat sample and send ESC sequences (documentation about printer ESC secuences available too).

pablov
  • 149
  • 10
  • I personally dropped the Bixolon jar, it wasn't necessary in my case as I could do everything that was needed just fine, directly, without using bixolon's API in between. It also kinda irked me that it's closed source, so God knows what's going on in there... :) – AgentKnopf Nov 27 '14 at 16:24