I'm trying to use the ZXing Barcode Scanner Intent in an emulator without a camera.
I can see from exhaustive Google searches that it's possible to suppliment Camera with another source. All roads point to http://www.tomgibara.com/android/camera-source, but no examples.
I can't figure out how to use it!
How do I use the barcode scanner without a camera in emulator? Examples would be much, MUCH appreciated.
So far I have a simple intent declaration, a Button to initiateScan()
, and the onActivityResult
listener to handle the scan result.
If you're integrating via Intent, then you are using the Barcode Scanner app as-is. (That's a good idea.) However the BS app has no notion of faking the camera on the emulator.
The link you provide is the very best for what you seem to want to do. You change uses of Camera
to use its CameraSource
and then slip in the fake implementation, instead of GenuineCamera
. But, that's a change you make to Barcode Scanner itself. Then you install modified BS on your emulator. Then you test by Intent.
Your app itself needs no changes to work on the emulator.