• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help led flashlight app for incredible

Status
Not open for further replies.
You probably won't need root.

you just need to go to the command line and type

echo "1" > /dev/<? some device name here?>

to turn on the LED

echo "0" > /dev/<? some device name here?>

to turn off the LED

if someone can figure out what the <? some device name here?> is I'll write a free app for it.

nevermind, I got it on the second read
 
You probably won't need root.

you just need to go to the command line and type

echo "1" > /dev/<? some device name here?>

to turn on the LED

echo "0" > /dev/<? some device name here?>

to turn off the LED

if someone can figure out what the <? some device name here?> is I'll write a free app for it.

Doesn't look like it'll work; permissions are read-only:

Code:
$ pwd
/sys/devices/platform/flashlight.0/leds/flashlight
$ ls -l
-rw-r--r-- root     root         4096 2010-05-13 01:00 uevent
lrwxrwxrwx root     root              2010-05-13 01:13 subsystem -> ../../../../../class/leds
lrwxrwxrwx root     root              2010-05-13 01:13 device -> ../../../flashlight.0
drwxr-xr-x root     root              2010-05-13 01:00 power
-rw-r--r-- root     root         4096 2010-05-13 01:13 brightness
-rw-r--r-- root     root         4096 2010-05-13 01:13 trigger
$ echo 127 > brightness
cannot create brightness: permission denied
 
For what it is worth, if anyone wants to try to expand on these ideas, I've tried:
1) Modifying brightness in the aforementioned flashlight.0/leds/flashlight directory -- can't get past permissions

2) Reflected CameraParameters, and manually added torch mode as a supported setting from my app(rejected at the driver level it seems)

3) Created a JNI library that tried to interface with:
a) camera/flash drivers themselves
b) liboemcamera.so (crashes on calling my_setledstate, might be return type, number of arguments, or argument type... or something else. Not sure how to get more details from it but it fails at the types/args I've thrown at it)
Code:
void* handle = dlopen("liboemcamera.so",RTLD_NOW|RTLD_GLOBAL);
    arbitrary my_setledstate;
    *(void**)(&my_setledstate) = dlsym(handle,"set_led_state");
    (void) my_setledstate(1);
    return 0;
c) Half a dozen other hair-brained ideas that are probably too stupid to write out

So if you have questions, or a light bulb goes off and you think to yourself... oh, he's an idiot but I can make it work like this, feel free to PM me.
 
Concerning the danger of overheating the LEDs.....why not make the standard flashlight at 80% or whatever is determined to be safe for longterm usage, and then add a "boost" function to set the LEDs to 100% for some fixed amount of time.

I would be willing to pay $10 or even $20 for a good, working, flashlight app. I used this feature at least once a day on my 6800 and I still miss it.
 
has HTC ever released their API for previous phones? (not the android API, there are several of those floating around) That's the key to getting this app created.

The Droid LED flashlight is hardware specific, as the Android API doesn't support LED control.
 
Concerning the danger of overheating the LEDs.....why not make the standard flashlight at 80% or whatever is determined to be safe for longterm usage, and then add a "boost" function to set the LEDs to 100% for some fixed amount of time.

I'm not too concerned about damaging the LEDs. A quick search didn't find any people that have burned theirs out on other phones, and LED's are extremely resilient as long as you don't supply too much voltage. That should be regulated by other aspects of the driver/hardware.

has HTC ever released their API for previous phones? (not the android API, there are several of those floating around) That's the key to getting this app created.

The Droid LED flashlight is hardware specific, as the Android API doesn't support LED control.

HTC releases the source, you can download it from:
HTC - Developer Center
 
What if you activate the flash then create a loop that keeps the led constantly on. Like start the flash via taking a picture but loop it so the flash stays on and the picture is never taken. Any devs been able to activate just the flash? Without taking a picture? Would that work at all. I realize that would be a last resort code but if that would work... cool.
 
Subscribed. I'll be on the list to get an app this is one of the big things still holding me to the moto droid vs the incredible.
 
There is an app now and it does work. Search led flashlight in the market and you ill find It. It isn't a smooth app at all but the dev said he will raise the price when he fixes the inconveniences. So get It now. It's the only one out there anyway!
 
There is an app now and it does work. Search led flashlight in the market and you ill find It. It isn't a smooth app at all but the dev said he will raise the price when he fixes the inconveniences. So get It now. It's the only one out there anyway!

It specifically says it does not work for the Incredible....
 
Incredible flashlight works like a champ! Must follow instructions though. A bit of a pain to power off device and back on to regain camera function but the leds do function as a flashlight without root!!
 
I am not paying a dollar for a broken app, and if he thinks a lot of people will pay much more even for a working one he is crazy, its just a flashlight, three dollars tops, fully functional.
 
I *might* pay a dollar if it was fully functional. To pay a dollar for a piece of half baked sofware is silly.
 
I am not paying a dollar for a broken app, and if he thinks a lot of people will pay much more even for a working one he is crazy, its just a flashlight, three dollars tops, fully functional.
Yeah I find it hilarious that he expects people to honestly pay that much (both for his "broken" version and the "fully working" one).
 
Does anyone know of a free flashlight app for the Incredible that uses the camera's led flash bulbs rather than just whiting out the screen? I've been waiting for the DroidLight by Motorola to update Incredible compatibility, but no such luck yet.

BTW, I've searched the other threads on this popular topic, but can't find an answer yet. The existing apps seem to have lots of bugs...
 
Status
Not open for further replies.
Back
Top Bottom