views:

689

answers:

1

Hi,

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.

A: 

There is no way to "simulate camera in the android emulator using the webcam" except by extensively modifying the Android firmware -- sorry!

CommonsWare
The tutorial from Tom Gibara says to have achieved it. http://www.tomgibara.com/android/camera-source The code is a little outdated though.
primalpop
No, his solution does not "simulate camera in the android emulator using the webcam". His solution involves a camera abstraction, allowing you to connect to the hardware camera or other image sources. If you are willing to commit to an abstraction layer in your production code, then his solution is a fine (but old) one. It does not, however, allow you to work with just the `Camera` class and somehow magically get its data from a webcam. And, as you point out, the `Camera` class has been significantly modified since he wrote his code, so his solution would need some updates.
CommonsWare
Hmm.. Seems like I have to give up this idea. Sad that even 2.2 sdk doesn't include a functionality for this.
primalpop