Search code examples
c#windowsuwpbarcode-scannerpointofservice

Universal Windows Platform (UWP) barcode scanner application


I want to create a simpe UWP barcode scanner application but I am unable to use my built in camera on my Lumia 950 or on my laptop, because PointOfService(POS) API seems to be working only with an external barcode scanner that is connected through USB port. I managed to successfully implement Windows Hello to my application, but to create a barcode scanner looks almost impossible, because there is no proper tutorial on the web. Can you please give me some advice, what API should I use? Because it looks that POS API will not work for me if I want to scan a barcode with built in camera on my devices.

I use BarcodeScanner class for detecion of the barcode scanner on my device. Here is a part of my code where I want to detect a barcode scanner:

BarcodeScanner scanner = await BarcodeScanner.GetDefaultAsync(); 

But i just get message, that no barcode scanner was detected, even if I add pointOfService to

<Capabilities>
    <DeviceCapabilities Name="pointOfService" />
</Capabilities>

Anyone some suggestions how to solve this issue? I searched through the forums but only solution that I found was ZXing API, but I would rather use native Microsoft API than 3rd party solutions, if it is possible. I use Visual Studio 2015.


Solution

  • Ok, it was pretty easy to implement ZXing API, now I get it working as it is supposed to work. There is very nice example how to implement barcode scanner with ZXing API, it is really worth of try.

    https://zxingnet.codeplex.com/SourceControl/latest#trunk/Clients/WindowsRTDemo/Package.appxmanifest

    So problem solved :)