Are there any camera resolution specifications while trying to scan barcode through android device?

I am connecting Visual studio 2017 enterprise version with a samsung tablet android device with camera 5 mega pixels. I am facing trouble with scanning barcode from the device and it is very rare that the device is able to read and scan it properly. I am using the below scanning code -

var scanPage = new ZXingScannerPage();

        scanPage.OnScanResult += (result) => {
            // Stop scanning
            scanPage.IsScanning = false;
            ZXing.BarcodeFormat barcodeFormat = result.BarcodeFormat;
            string type = barcodeFormat.ToString();

            // Pop the page and show the result
            Device.BeginInvokeOnMainThread(() => {
                DisplayAlert("The Barcode type is : " + type, "The text is : " + result.Text, "OK");

        // Navigate to our scanner page

This code does works but for a very few times. My android device is able to read and scan but its very hard. Are there any device camera requirements or any properties which I am missing because barcode scanning should not be hard for a device to read and scan.

Any inputs or help in order to resolve my issue will be appreciated.


  • BillyLiuBillyLiu Member, Xamarin Team Xamurai

    Your code looks fine, could you reproduce this issue on other devices?

  • AmanpreetAmanpreet Member ✭✭

    Yes , I did tried replicating in one of the dell tablet devices with same camera configuration and observed the same behavior. I have also tried downloading the bar-code scanner app by zxing team and tried to scan same bar-codes through the same devices and observed that even app was not able to read through the bar-codes. That's the reason I am checking on if there are any camera resolution configurations required or any other requirements for running bar-code scanner on android devices.

Sign In or Register to comment.