Using Camera in the Android Emulator

Using Camera in the Android emulator

Update: ICS emulator supports camera.

Android: How to use webcam in emulator?

UPDATE

In Android Studio AVD:

  1. Open AVD Manager:

AVD menu


  1. Add/Edit AVD:

Specific AVD strip


  1. Click Advanced Settings in the bottom of the screen:

AVD Advanced Settings


  1. Set your camera of choice as the front/back cameras:

AVD Camera Settings

Emulator camera

Add following permission in Manifest file

<uses-feature
android:name="android.hardware.camera.any"
android:required="true" />
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false" />

Also, you need to implement Runtime Permission refer developer page,
example 1 and example 2

Camera in Android Oreo emulator

As said by @dythim you click on Tools->Android-> AVD Manager then you chose the AVD to edit, if the camera feature is not on the first screen but you can see Show advanced Settings then click on the button to show advanced settings. For camera option choose Webcam0 as value to use for front and back cameras.

Android emulator settings no camera option (for virtual scene)

When you create a new Android Virtual Device (AVD) and in my case I used one with Play Store support.

In the Verify Configuration screen, click on [Advanced Options] and you should see:

Verify Configuration Screen

And make sure that Camera Back is set to 'VirtualScene'.

As documented in Step 5 of ARCore - Create a virtual device with AR support



Related Topics



Leave a reply



Submit