android - Xamarin Forms QR code scanner blank screen -
i have xamarin forms 2.0 application uses zxing.net.mobile , zxing.net.mobile.forms version 2.0.3.1. i'm trying build simple qr code scanner, whenever launch zxingscannerpage on android can see default overlay (with text , red line) don't see output of camera can't scan anything. have listed camera permission in androidmanifest:
<uses-permission android:name="android.permission.camera" /> i tried sample code readme: https://github.com/redth/zxing.net.mobile samples/forms project. have code:
private async void onscanqrclicked(object sender, eventargs e) { _scannerpage = new zxingscannerpage(); _scannerpage.onscanresult += handlescanresult; await navigation.pushasync(_scannerpage); } private void handlescanresult(result result) { _scannerpage.isscanning = false; device.begininvokeonmainthread(() => { navigation.popasync(); displayalert("scanned code", result.text, "ok"); }); } some more specs: i'm running android 5.1 on moto g (v1).
why not seeing output of camera?
i fixed getting rid of zxing.net.mobile.forms , downgrading zxing.net.mobile 2.0 1.5. had change implementation, relatively easy.
another thing people may @ in future (i didn't try it) adding flashlight permission: https://github.com/redth/zxing.net.mobile/issues/227.
Comments
Post a Comment