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 <userdirectory>/.android
folder.
File: ~/.android/config.ini
hw.lcd.density=160<br>
skin.name=HVGA<br>
skin.path=platforms\android-9\skins\HVGA<br>
hw.cpu.arch=arm<br>
abi.type=armeabi<br>
vm.heapSize=24<br>
image.sysdir.1=platforms\android-9\images\<br>
hw.camera=yes<br>
sdcard.size=64M<br>
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:
- 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.
- 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.
- 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.
- Save the changes and launch the emulator.