I know how to get a lux value from the light sensor using android.hardware.sensor.
I saw light meter tools on the market. The application description said it can get the lux value from the camera. How can it do that?
Also how can I set the shutter speed and the aperture?
Take a look at the
Camera.Parametersclass.It has all functions supported by the Camera. Probably
setExposureCompensation.I don’t know much about photography but my guess would be that exposure compensation is changing aperture or speed.
It could be that the tool you mentioned is using a bundled native library. Also have a look at how the functions given in
Camera.Parametersclass work (check android source code).you can also use Ambient light sensor to get the light level in lux units (if this is within the scope of your project). From android documentation:
Android Developer: Light Sensor-Sensor Event
You can find more information about the light sensor in the documentation.
Android Developer: Sensor