Hi,
Thanks for reaching out to the Android CameraX Discussion Group.
If you are using an older version of CameraX, you may need to update your code to use the new ExposureCompensation API.
To use the new API, you first need to get an instance of the CameraControl class. You can do this by calling the getCameraControl() method on your Camera object. Once you have a CameraControl object, you can use the setExposureCompensationIndex() method to set the exposure compensation value.
The setExposureCompensationIndex() method takes an integer value as an argument. This value represents the exposure compensation index. The range of possible values for the exposure compensation index depends on the camera device. You can get the range of possible values by calling the getExposureCompensationRange() method on the CameraInfo object.
Here is an example of how to use the ExposureCompensation API:
```
// Get a CameraControl instance
CameraControl cameraControl = camera.getCameraControl();
// Get the exposure compensation range
Range<Integer> range = camera.getCameraInfo().getExposureState().getExposureCompensationRange();
// Set the exposure compensation index
int index = 2;
if (range.contains(index)) {
cameraControl.setExposureCompensationIndex(index);
}
```
If you have further questions or run into any issues, feel free to provide more context (like your CameraX version, code snippets, etc.) and we'll do our best to help!