Using Camera in the Android emulator

人盡茶涼 提交于 2019-11-26 20:33:33

Update: ICS emulator supports camera.

In your AVD advanced settings, you should be able to set front and back cameras to Webcam() or Emulated.

Curious Lemming

Some elaboration, in the hope of clarifying what has already been said:

As stated above, Webcams are supported natively in the current SDK, but only on recent android versions (4.0 and higher)

Webcam detection is automatic where present. In 4.0.3, the camera defaults to the front-facing camera so a lot of applications (especially pre-2.3 applications, which can only fetch the default camera, i.e. the back-facing one) will still show you the old checkerbox-with-moving-square stand-in instead.

I think some more info is available in the following post: Camera on Android Eclipse emulator:

Or at least, that's the most information I've been able to find--aside from the brief, uninformative statements in the release notes for the SDK tools.

Update of @param's answer.

ICS emulator supports camera.

I found Simple Android Photo Capture, which supports webcam in android emulator.

Does not seem like it, but android recognises a webcam as a device. Every time I run the emulator my webcam's active light comes on.

There is an updated version of Tom Gibara's tutorial. You can change the Webcam Broadcaster to work with JMyron instead of the old JMF.

The new emulator (sdk r15) manage webcams ; but it has some problems with integrated webcams (at least with mine's ^^)

The newest camera2 apis work fine w/ an emulator that has camera support enabled.

Example for using the newer API:

https://github.com/googlesamples/android-Camera2Basic/blob/master/Application/src/main/java/com/example/android/camera2basic/AutoFitTextureView.java

Just in case you just need to show a picture in response to a camera request, there is image-to-camera.

Just download, build, install, copy an image of your choice to the device, and you can select it via the app, which is an alternative to the built-in camera.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!