capacitor-community / barcode-scanner

A fast and efficient (QR) barcode scanner for Capacitor
MIT License
437 stars 172 forks source link

Testing scanner on android emulator #109

Closed jahnavi310 closed 2 years ago

jahnavi310 commented 2 years ago

Hi there,

I have installed the plugin and everything seems to work fine hence so far... For some reason I am running into an issue where I am unable to test the scanner on the android emulator, it looks like the camera is just open in the background and running. The CSS for all the components has been set to have a background of transparent none, so not really sure what the issue could be here...

Could it be possible that this can only be tested on a real device? Any advice would be greatly appreciated.

Thanks in advance.

JanMisker commented 2 years ago

I've tested succesfully on Android emulator. You have to make sure that the virtual device has a webcam configured. You can also try chrome://inspect (in Chrome) to connect to the emulator and see if indeed all dom elements have a transparent background.

jahnavi310 commented 2 years ago

@JanMisker: I figured out that the issue was related to the scanner being opened inside the ion-routeroutlet and ion-content, but now this is good to go... Another quick question on this for you, are you actually able to scan the barcode on the emulator? like get the result from the barcode on an emulator?

Thanks in advance...

thegnuu commented 2 years ago

@jahnavi310 In my setup scanning works with the emulator. My test webcam is kinda bad so the resolution is not ideal which might result in longer scan-times, but in general it works.

What kind of code are you trying to scan?

jahnavi310 commented 2 years ago

@thegnuu - i am just trying to scan an example code that has minimal data in it... but i do not see the contents of the code being logged in the chrome console

thegnuu commented 2 years ago

Can you provide an example of your implementation or share a repo? This would really help to point you to the right direction :)

jahnavi310 commented 2 years ago

@thegnuu - I got up and running and it also does the scanning :)... thanks so much for the quick responses...

thegnuu commented 2 years ago

Great! In that case I will close this issue :)