title: Change Camera Settings for the Camera2 API android
body: <p>I am using the <a href="https://github.com/hzitoun/android-camera2-secret-picture-taker" rel="nofollow noreferrer">android-camera2-secret-picture-taker</a>
  and getting the image which is dark and not able to change the whiteblance in capture builder.
  Here is what changing I have made to capturebuilder:</p>
  
  <p>/**Settings for Camera*/
  //        captureBuilder.set(CaptureRequest.CONTROL_MODE, CameraMetadata.CONTROL_MODE_AUTO);
          captureBuilder.set(CaptureRequest.JPEG_ORIENTATION, getOrientation());</p>
  
  <pre><code>    /**HDR*/
          captureBuilder.set(CaptureRequest.CONTROL_SCENE_MODE, CameraMetadata.CONTROL_SCENE_MODE_HDR);
  
      /**Settings for Flash*/
          captureBuilder.set(CaptureRequest.FLASH_MODE, CameraMetadata.FLASH_MODE_TORCH);
  
  captureBuilder.set(CaptureRequest.CONTROL_AWB_MODE, CaptureRequest.CONTROL_AWB_MODE_AUTO);
  
  /**for White Balance */
          captureBuilder.set(CaptureRequest.CONTROL_AWB_MODE, CaptureRequest.CONTROL_AWB_MODE_AUTO);
              captureBuilder.set(CaptureRequest.COLOR_CORRECTION_MODE, CaptureRequest.CONTROL_AWB_MODE_AUTO);
              captureBuilder.set(CaptureRequest.COLOR_CORRECTION_GAINS, colorTemperature(CaptureRequest.CONTROL_AWB_MODE_AUTO));
  
  //for incandescent
              captureBuilder.set(CaptureRequest.COLOR_CORRECTION_MODE, CaptureRequest.CONTROL_AWB_MODE_INCANDESCENT);
              captureBuilder.set(CaptureRequest.COLOR_CORRECTION_GAINS, colorTemperature(CaptureRequest.CONTROL_AWB_MODE_INCANDESCENT));
  //        captureBuilder.set(CaptureRequest.COLOR_CORRECTION_GAINS, CameraCapabilities.colorTemperature(Integer.parseInt(awbMode)));
  
  //for daylight
  captureBuilder.set(CaptureRequest.COLOR_CORRECTION_MODE, CaptureRequest.CONTROL_AWB_MODE_DAYLIGHT);
              captureBuilder.set(CaptureRequest.COLOR_CORRECTION_GAINS, colorTemperature(CaptureRequest.CONTROL_AWB_MODE_DAYLIGHT));
          }
  
  //for fluorescent
  captureBuilder.set(CaptureRequest.COLOR_CORRECTION_MODE, CaptureRequest.CONTROL_AWB_MODE_FLUORESCENT);
              captureBuilder.set(CaptureRequest.COLOR_CORRECTION_GAINS, colorTemperature(CaptureRequest.CONTROL_AWB_MODE_FLUORESCENT));}
  
  //for cloudy
              captureBuilder.set(CaptureRequest.COLOR_CORRECTION_MODE, CaptureRequest.CONTROL_AWB_MODE_CLOUDY_DAYLIGHT);
              captureBuilder.set(CaptureRequest.COLOR_CORRECTION_GAINS, colorTemperature(CaptureRequest.CONTROL_AWB_MODE_CLOUDY_DAYLIGHT));
  
  /**For ISO*/
      captureBuilder.set(CaptureRequest.CONTROL_MODE, CameraMetadata.INFO_SUPPORTED_HARDWARE_LEVEL_FULL);
      CameraCharacteristics mCameraCharacteristics = characteristics;
      List keys_list = characteristics.getKeys();
      Range&lt;Integer&gt; range2 = characteristics.get(CameraCharacteristics.SENSOR_INFO_SENSITIVITY_RANGE);
      int iso = ((200 * (200 - 100)) / 100 + 100);
      if (range2 != null) {
          int max1 = range2.getUpper();//10000
          int min1 = range2.getLower();//100
          iso = ((max1 * (max1 - min1)) / 100 + min1);
      }
      captureBuilder.set(CaptureRequest.SENSOR_SENSITIVITY, iso);
  </code></pre>
  
  <p>I am not able to change the brightness, and other settings except the FlashMode.</p>