Search code examples
androidandroid-cameraandroid-camera-intent

Enable HDR option before starting camera intent


My app is taking pictures with the native android camera. With my Motorola X 2, everything is going fine when the intent is launching. I can change settings, luminosity, HDR option etc.

I installed the same application on a Nexus 5 (Android 6.0.1). I started the application and then the camera intent. The device won't allow to change the HDR settings. Otherwise, in the native camera application, I can change these settings.

enter image description here

Is there a way to enable programmatically the HDR option on the camera before starting the intent ?

Or another way to fix it ?


Solution

  • Is there a way to enable programmatically the HDR option on the camera before starting the intent ?

    No.

    Or another way to fix it ?

    Take the pictures yourself, using the camera APIs. Note that this is rather complex.

    Right now, you are delegating to a third-party camera application. There are over 8000 Android device models. There will be hundreds of different pre-installed camera apps across those models, plus many more that users install from the Play Store or elsewhere. None of them have to offer HDR control to the user. None of them have to offer you the ability to request a particular HDR setting. And your app could wind up requesting any of those, based upon device and user.

    In your case, on one of your devices, one of the hundreds of camera apps happens to offer HDR control when launched normally and not offer HDR control when launched via ACTION_IMAGE_CAPTURE (or whatever other Intent action that you are using). Either the developers of that camera app chose that behavior intentionally, or they have a bug in their app. Regardless, there is nothing that you can do about it.