PUBLIC WARNING! Barcode scanning in Xamarin Forms

BACKGROUND:
We are building a Xamarin Forms product that uses barcode scanning as a central function. In the early stages we decided not to buy a barcode scanning component, but use the free ZXing component until later in the development phase. We are now at the stage where we would want to buy and use a commercial barcode scanning component as the sample apps they provide indicate a clear performance advantage.

PROBLEM:
Of the three commercial components in the Xamarin Components Library there are exactly 0 that can be used in a Xamarin Forms solution:

  1. RedLaser does not exist any more (sign-up page closed, emails sent to them bounce back)
  2. Scandit does not support XF ( as per an email response from them)
  3. Manatee does not support XF either (also stated in an email response)

SOLUTION:
Write a wrapper for Scandit or Manatee. I found a wrapper for Scandit, but actually prefer Manatee's pricing model.
I have tried to write a wrapper my self, but it seems I am doing it wrong since calling the Scan() method just crashes my app without ANY debugging information at all. If this fails, the project will be in jeopardy.

If you want to build an app that scans barcodes, makes sure you investigate the lack of Xamarin Forms support before starting!

Posts

  • OtaMaresOtaMares DEMember ✭✭

    Maybe this helps https://github.com/rebuy-de/rb-forms-barcode its our own barcode scanning library based on zxing.

  • uwantfriesuwantfries GBBeta ✭✭
    edited September 2015

    I used ZXing.Net.Mobile quite successfully with a simple interface called IQRScanner with one method

    Task<string> Scan(); 

    and implemented it as a dependency in the iOS and Android code branches.

    Accuracy seems good and the UI was OK too (I did not customise the UI apart from prompt text).

    Top Tip: dont use the built in AVCaptureSession (iOS7 Built in) in iOS - its rubbish. Stick with the default ZXing capture engine, its much better.

  • JasonAwbreyJasonAwbrey USInsider, University, Developer Group Leader mod

    We are using barcode scanning in our XF project via DI - Scandit on the Android side, native iOS scanning on the iOS side.

    There are a LOT of things that XF does not support out of the box, but are easily achieved via DI or custom renderers.

  • BrianRepettiBrianRepetti USUniversity ✭✭✭

    I use zxing heavily. Not sure you have any idea what your talking about.

  • cvarelaecvarelae USMember ✭✭

    @JasonAwbrey How do you use to a native iOS scanning from a xamarin ios project? Thanks a lot

  • Everything is compatible with xamarin forms, you only have to use the dependency service to make it work

  • ManateeWorksManateeWorks USMember

    The Manatee Works Barcode Scanner SDK Xamarin package within our Developer Network now contains demonstration/sample source code for using the SDK in Xamarin Forms, as well as detailed instructions on how to add the SDK to your current MTD project.

  • Johan_SchoemanJohan_Schoeman ZAMember ✭✭

    ManateeWorks has indeed enabled my project to go forward!

  • nbevansnbevans USMember ✭✭✭

    I'm intrigued as to what the "public warning" is here?

  • Richard.LeonardRichard.Leonard GBMember ✭✭

    Just for anybody else implementing the Dependency Service approach my app kept crashing when it called the .Scan method. After plenty of investigation I found out that I did not have Landscape Left / Landscape Right selected in my info.plist file under the "iPhone / iPod Deployment Info" section

  • NerudoMregiNerudoMregi USMember

    @Richard.Leonard said:
    Just for anybody else implementing the Dependency Service approach my app kept crashing when it called the .Scan method. After plenty of investigation I found out that I did not have Landscape Left / Landscape Right selected in my info.plist file under the "iPhone / iPod Deployment Info" section

    You saved my life!!!! Wish they documented this. @MenateeWorks

  • BjornBBjornB USMember ✭✭✭
    edited September 2017
    1. Scandit does not support XF ( as per an email response from them)
    2. Manatee does not support XF either (also stated in an email response)

    but they support Xamarin.Android and ios, XF is just an abstraction on top of a platform... (= this is not a problem)
    https://xamarinhelp.com/xamarin-forms-dependency-injection/

    You dont deploy a pcl to your phone...

  • jaYCee.1750jaYCee.1750 USMember ✭✭

    Is there no other scanners developed from xamarin aside from Manatee, Scandit and ACR?

  • abraabra ADMember ✭✭✭

    Is Manatee free, or is there a license fee to be paid? What is the license model ?

  • HarshitaHarshita INMember ✭✭✭

    Watch this video it will help you to create Barcode and QR code both with few line of code-

  • hedgefencehedgefence Member

    Would be great to have this video in english.

  • CarlBartonCarlBarton USInsider, University, Developer Group Leader ✭✭

    @Harshita Thank you for posting a very concise video for using ZXing with Xamarin Forms.

    In spite of not understanding much of the audio, I was still able to follow along without issue.

  • RobertBrown.5268RobertBrown.5268 USUniversity

    Great video @Harshita thankyou, despite me not speaking Hindi I was able to follow it visually!

    One additional thing I had to do though which I don't think was in your video, is that I had to add the line:

    ZXing.Net.Mobile.Forms.Android.Platform.Init()

    into my MainActivity.cs in the Android project just before the

    global::Xamarin.Forms.Forms.Init(this, bundle);

    line that was already there. Until I did this, I was just getting a white screen after pressing the Scan button on the app.

  • HarshitaHarshita INMember ✭✭✭

    @RobertBrown.5268
    On some device you will need to initialized Zxing plugin on mainActivity before use it :)

  • ScangineTeamScangineTeam Member
    edited June 17

    Our new alternative !
    **Scangine Barcode Scanner SDK for Android and iOS
    **
    check our page:
    scangine.com

    No QR yet but if you need just 1-D codes scanning - you will be happy with our SDK

  • dinobdinob USUniversity ✭✭✭
    edited August 2

    @nbevans said:
    I'm intrigued as to what the "public warning" is here?

    ... or why everyone keeps talking about camera based scanning and ZXing when Johan clearly asks for a non ZXing solution and it looks like for a non-camera solution.

  • dinobdinob USUniversity ✭✭✭
    edited August 2

    @Harshita said:
    @RobertBrown.5268
    On some device you will need to initialized Zxing plugin on mainActivity before use it :)

    Thanks for the video, I could not understand word but still very helpful. However, we find ZXing lib to be slow. Lib might not be slow by itself but camera scanning is slow, need to focus, align, read ....
    What about solution for external barcode scanners such as bluetooth connected scanners with an IOS device?

  • dinobdinob USUniversity ✭✭✭

    @Johan_Schoeman said:
    ManateeWorks has indeed enabled my project to go forward!

    Can you share bit more?

  • dinobdinob USUniversity ✭✭✭

    Figured it out, and did it according to this article I wrote after long research and back and forth with number of vendors on this topic.

    It works great for me, no need for SDKs. Working on Android, IOS, havent tried UWP
    https://medium.com/@mypascal2000/barcode-scanners-simplified-1a4fb7ef621b

    The article summarizes pros and cons of the approach, to me pros are overwhelming and cons are not affecting me. If it works for you, great. If it does not and you find better solution, please share.

Sign In or Register to comment.