Is there a way to set the LED intensity that I desire? I know that to turn on the LED I use:
p.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH); mycam.setParameters(p);
But this code just turns on the LED. But is there a way to set different intensities to the LED for a stronger light or to reduce the light intensity?
Tap and hold the Flashlight icon until you see the slider appear. 3. Swipe up or down to control the brightness of the flashlight.
Open the Settings app, then go to System → Gestures → Quick Tap. Turn on the feature by pressing the Use Quick Tap button. Scroll down, then tap the Toggle flashlight option. Double-tap the back of your phone to make sure you see the Quick Tap detected notification.
HTC has an alternative API that supports this, however it's only on HTC Sense devices, and as of Gingerbread they've changed the permissions so it's only for their Flashlight app, not third party ones (unless you use root).
But on 2.2 HTC devices you can use it by writing a string to /sys/devices/platform/flashlight.0/leds/flashlight/brightness
. This controls if the LED is on and how bright it is. For maximum brightness write "128\n"
, half brightness write "64\n"
. Easy to test from adb shell:
echo "128" > /sys/devices/platform/flashlight.0/leds/flashlight/brightness
And finally turn it off by writing "0\n"
there.
Short answer is: NO.
Longer answer - maybe on some devices using undocumenterd calls / parameters. Supported flash modes, and their meanings (and behaviours) differ from device to device.
Your best option is to query supported flash modes, and hope they work as intented.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With