Implementing Bluetooth features to Print on a bluetooth printer in Xamarin Forms App

RavindraKumarRavindraKumar USMember ✭✭
edited December 2017 in Xamarin.Forms

I'm trying to avail Bluetooth features in my Xamarin Forms App to Print on a bluetooth printer but can't get it working.
Even not able to search devices and pair.
I tried below two plugins but none of them works for me.

  1. https://github.com/aritchie/bluetoothle
  2. https://github.com/xabre/xamarin-bluetooth-le

I tried this example as well:

https://julianocustodio.com/2017/12/07/bluetooth/amp/?__twitter_impression=true

Does anyone have working example?
Any help is much appreciated.

Thanks

Best Answer

Answers

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    "doesn't work" is very vague. Is it throwing an exception? Not connecting... You could be 99% there and just have a binding issue that keeps the UI from updating the list of available devices.

    Your best bet for help is to put your test project in a GitHub repo so others can take a look and spot where you may have gone astray.

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    are you sure your printer is BLE?

  • RavindraKumarRavindraKumar USMember ✭✭

    @AlessandroCaliaro said:
    are you sure your printer is BLE?

    Thanks for quick response.
    Just had words with provider and confirmed Bluetooth version. Its 2.0, so obviously its not BLE.
    Can you please provide me some snippets of codes to connect with Classic bluetooth and print on a Bluetooth Thermal Printer.
    Thanks

  • RavindraKumarRavindraKumar USMember ✭✭

    @ClintStLaurent said:
    "doesn't work" is very vague. Is it throwing an exception? Not connecting... You could be 99% there and just have a binding issue that keeps the UI from updating the list of available devices.

    Your best bet for help is to put your test project in a GitHub repo so others can take a look and spot where you may have gone astray.

    Hi @ClintStLaurent ,

    I tried below sample project from git and it builds and successfully run on device, but it doesn't find any nearby device.
    And obviously paring is yet to see.

    https://github.com/juucustodio/Bluetooth-Xamarin.Forms

    I also wrote to the author and waiting for his response.

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    which is the printer?

  • ShantimohanElchuriShantimohanElchuri USMember ✭✭✭✭✭

    @RavindraKumar said:
    Hi @ClintStLaurent ,

    I tried below sample project from git and it builds and successfully run on device, but it doesn't find any nearby device.
    And obviously paring is yet to see.

    https://github.com/juucustodio/Bluetooth-Xamarin.Forms

    I also wrote to the author and waiting for his response.

    I also tried this sample, after translating the strings to English. I tried it on my Note 8 and it works. But I am not sure what it is connecting to as I get only MAC Addresses for many of the devices. On Note 8 I often see similar lists with a description that "Name will be displayed once it is connected". And I don't know how to get the MAC Address of the BT devices that I have in hand. I tried with my Jabra earbuds for which the name is displayed. I start the pairing mode and try to connect through this app. The app reports it is connected but the pairing message continues in the earbuds and the phone also doesn't show as if it is connected. But once I refresh the list the Jabra is not listed.

    That's my experience. Even I am looking for XF solution for managing BT (LE or not) devices.

  • RavindraKumarRavindraKumar USMember ✭✭
    > @AlessandroCaliaro said:
    > which is the printer?


    Sorry for delayed response.
    I'm outstation. Here I have attached the full specification of the printer.
    Please check it out...
    Thanks
  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    @RavindraKumar said:
    > @AlessandroCaliaro said:
    > which is the printer?


    Sorry for delayed response.
    I'm outstation. Here I have attached the full specification of the printer.
    Please check it out...
    Thanks

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
    There is a Sdk for Android

    You can creta a Binding with Jar library and try to use it

    Otherwise you can try to create an SPP connection with a Bluetooth socket
  • RavindraKumarRavindraKumar USMember ✭✭
    Accepted Answer

    @AlessandroCaliaro said:
    There is a Sdk for Android

    You can creta a Binding with Jar library and try to use it

    Otherwise you can try to create an SPP connection with a Bluetooth socket

    Thanks @AlessandroCaliaro
    Binding with Jar lib worked for me.

  • jamesGjamesG Member ✭✭
    edited April 2018

    @RavindraKumar would you mind share how you work with binding JAR to Xamarin forms. I hope you can help me..
    Thank you very much

  • DuongNguyen.0603DuongNguyen.0603 USMember ✭✭

    @RavindraKumar could you please share with us how to working with binding JAR to xamarin forms? I wasted for days to find a way to work with bluetooth printer. Thanks

  • sigridslimasigridslima BRMember ✭✭

    @RavindraKumar ola esou com o mesmo problema, vc poderia postar o codigo com foi feito. Obrigado.

  • sudheer_babusudheer_babu Member ✭✭

    @RavindraKumar Can u please give me suggestion how to start working on bluetooth printer implementing in my Xamarin forms application I found some samples and implemented in my app but not worked and I tried Zebra LinkOS multiplatform plugin but not worked in my app because of Xamarin forms package is 2.3.4.247

Sign In or Register to comment.