Android Emulator: Unable to start webcam to capture picture in emulator

后端 未结 5 1558
长发绾君心
长发绾君心 2021-02-03 19:54

I have created an armeabi API 21 emulator in the AVD manager in Android Studio, set it to use the webcam as a front camera, and launched it. The problem is that it\'s not able t

5条回答
  •  难免孤独
    2021-02-03 20:24

    To enable Camera in your Android Emulator, just add following highlighted code in your AVD’s config.ini file. You can find the config.ini file under your /.android folder.

    File: ~/.android/config.ini

    hw.lcd.density=160
    skin.name=HVGA
    skin.path=platforms\android-9\skins\HVGA
    hw.cpu.arch=arm
    abi.type=armeabi
    vm.heapSize=24
    image.sysdir.1=platforms\android-9\images\
    hw.camera=yes
    sdcard.size=64M

    In case you don’t find the config.ini file or want to enable Camera support through Android SDK and AVD Manager do the following:

    Open Android SDK and AVD Manager:

    1. Add SD Card in AVD
      In the SD Card setting, set the value for Size. To enable camera, the SD Card must be enabled in Emulator.
    2. Add Camera Support in Hardware under AVD
      Now under Hardware section, click New button to add Camera hardware. It will open following Dialog box. Select Camera support from the Property dropdown and click Ok.
    3. Enable Camera Support in Hardware
      The new hardware: Camera support is visible under Hardware section. Set its value to yes and save changes by pressing Edit AVD.
    4. Save the changes and launch the emulator.

提交回复
热议问题