Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all!
i have create a project scan barcode with library Zxing/Zbar
so, when i test project by my webcam with emulator,
display same as http://www.tomgibara.com/images/android-camera-genuine.png[^]
so, when i click camera of emulator, webcam is used, verry good!
plz help me!
thanks so much!

--- my code same as here
https://github.com/DushyanthMaguluru/ZBarScanner/blob/master/examples/ZBarScannerDemo/src/com/dm/zbar/android/examples/MainActivity.java[^]
this use zbar library
and so use zxing library
http://www.mysamplecode.com/2011/09/android-barcode-scanner-using-zxing.html[^]
Posted
Updated 29-May-13 23:03pm
v3
Comments
Cycy The Empress 30-May-13 5:14am    
The question is not very precise. You want the emulator to use the real camera instead of this (http://www.tomgibara.com/images/android-camera-genuine.png), right ?

A few more details would be helpful, like which version of Android and of the SDK are you using.
dev C plus 30-May-13 5:25am    
yes! it's!
i using android SDK version 15 Platfrom 4.0.3
thanks for your report
Cycy The Empress 30-May-13 5:30am    
Have you tried to edit the properties of the emulator ? (In the AVD manager, select your device, click "Edit") You should be able to change the "Back Camera" value.
dev C plus 30-May-13 5:43am    
yes,i have tried to edit.
So, in the AVD Manager, i show only "Camera Support", not found "Back Camera" at property Hardware.
when i change value of "Camera Support" to "yes", i can use my webcam when i click camera of emulator. But, when run my apps sample ZBAR/ZXING, i have a display same as (http://www.tomgibara.com/images/android-camera-genuine.png).
where can i fix it ???
Cycy The Empress 30-May-13 5:59am    
Actually I use the Android SDK Tools rev. 21.1, and in my AVD properties window I have an option for Back Camera. Maybe try to update the SDK Tools to see if this helps.
Else, you can use this: http://www.tomgibara.com/android/camera-source
In my opinion, the best thing is still to use a real Android device with USB debug mode activated instead of the emulator. ;)

1 solution

i have fixed !!!
At line camera = Camera.open;
i have change it by camera = Camera.open(CameraInfo.CAMERA_FACING_BACK);
webcam on emulator is good (y)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900