I wish to simulate camera in the android emulator using the webcam. Basically I need to only take photos with the camera in the emulator (live preview is not needed i.e if it makes it any easier)
I followed the tutorial here which is the only one I could find that was close to my requirements
But many of the libraries used in that tutorial(like android.hardware.CameraDevice) are not available in present sdk and are replaced by new libraries(like android.hardware.camera).
Any help on how to do this in the present sdk(2.1 or 2.2) would be much appreciated.
You need to edit your AVD so that in the hardware section either "Configures camera facing front" or "Configures camera facing back" are available. One, but not both, of the values for these properties should be set to "webcam0" (or whatever is available).
How Do I Enable The Camera On My Emulator? To edit (pencil) in Android Studio's actions, open the AVD Manager and then click on edit. In the next window, go to Advanced settings, then scroll down and in the camera settings option, click back on webcam.
In your AVD advanced settings, you should be able to set front and back cameras to Webcam()
or Emulated
.
Update: ICS emulator supports camera.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With