I'm looking for something like this:
CameraManager cameraManager = (CameraManager) getSystemService(CAMERA_SERVICE);
cameraManager.setTorchMode("0", true);
cameraManager.setTorchLevel("0", 2); //change the brightness based on the number given
I'm looking for something like this:
CameraManager cameraManager = (CameraManager) getSystemService(CAMERA_SERVICE);
cameraManager.setTorchMode("0", true);
cameraManager.setTorchLevel("0", 2); //change the brightness based on the number given
This will work only on devices with android 13 and new version of camera hardware abstraction layer (tested on pixel 6 pro). It might also work on some samsung devices with lower android version (not tested).