问题
I'm developing a qr code reader application. How can I use my webcam as a camera to scan the qr code in the emulator ?
my SDK version is 4.3. I checked it out in developer.android site and they said that you have to select webcam0 as a back camera. I tried but it didn't work, and shows "unfortunately your app has been stopped".
回答1:
Follow the below steps in Eclipse.
- Goto -> AVD Manager
- Create/Edit the AVD.
- Hardware > New:
- Configures camera facing back
- Click on the property value and choose = "webcam0".
- Once done all the above the webcam should be connected. If it doesnt then you need to check your WebCam drivers.
check this answer for the image & a further link:
Here
回答2:
Have you set front/Back cameras when you created the emulator like this in your AVD manager

回答3:
The Android Studio virtual emulator now has virtual scene images under the camera section of the extended controls. With this you add any image to be scanned by the virtual emulator. Had a little trouble finding it though as you have to navigate into a different room to see it in the virtual scene. Can't see virtual scene images in emulator camera app
来源:https://stackoverflow.com/questions/18381344/how-to-use-a-pc-webcam-as-the-emulators-camera