The Android Emulator Lies!

Working on an Android application and aiming to support a variety of different hardware is an interesting challenge, not least of which being that the Android emulator lies to you about its capabilities.

I created a new AVD (android virtual device) and specifically set the parameter (which the documentation says defaults to “no” anyhow) so that there would be no camera:

AVD details

Later on, just to check what my code was doing I added a log statement after I queried what the package manager thought would be the capability:

    boolean hasCamera = packageManager.hasSystemFeature(
        PackageManager.FEATURE_CAMERA);
    Log.e("DeviceSettings", "Package manager said about camera: "+hasCamera);

And the output?

DDMS Log

The emulator lies! How am I meant to do my job? *sigh*

One Response to “The Android Emulator Lies!”

  1. Ali says:

    Take nasty crappy pink Samsung Intercept, perform surgery and remove its camera, test on that.