Android emulator camera custom image Android emulator camera custom image android android

Android emulator camera custom image


Under Tools > AVD Manager, select the "pencil" to get to "Virtual Device Configuration". Show Advanced Settings > Camera will give you the option of using emulated, or a device:

Device - use host computer webcam or built-in camera

Virtual Device Camera Configuration

If all you need is to get a still image into the camera, starting with Android Studio 3.2 you can put your static images into the virtual scene:

Virtual Scene Demo

as discussed in this entry from Android developers blog. Note that you'll need to move the camera position into the dining room to see your images (turn around and use Alt-w to move forward).


Finally!

  1. Append to file ~/Android/Sdk/emulator/resources/Toren1BD.posters
poster customsize 2 2position 0 0 -1.8rotation 0 0 0default custom.png
  1. Place 'custom.png' in ~/Android/Sdk/emulator/resources/
  2. Restart! emulator @Phone -no-snapshot -no-boot-anim (replace 'Phone' with the name of your avd! (see: emulator -list-avds)
  3. Profit!

Now you have a texture just in front of camera-default-position.


It seems the only solution is to use a remote camera.

This is one way to do it: http://www.tomgibara.com/android/camera-source

It's not something what I was looking for but I think it can be used for testing. Maybe even barcode scanner would work with this if the barcode is placed properly in front of camera.