10

I am looking for help in Android camera LED Flash for changing intensity of it like this app.

I have checked following link but i am not getting exact result from it.

  1. Can I change the LED intensity of an Android device?
  2. How to turn on camera flash light programmatically in Android?
  3. http://code.google.com/p/droidled/source/checkout
  4. http://code.google.com/p/simpleled/source/checkout
  5. https://code.google.com/p/openintents/source/checkout

And I am not able to execute this link (it seems promising to me).

Any help is greatly appreciated.

Community
  • 1
  • 1
NIKHIL
  • 2,719
  • 1
  • 26
  • 50

1 Answers1

1

found the answer here

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.

Community
  • 1
  • 1
Archit Jain
  • 487
  • 1
  • 3
  • 12