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

FlashLight that uses Camera Flash

Has anyone got it to fire the flash in your own application under any circumstance? (e.g. actually taking a picture)

edit:
Just after I posted this... I actually got a flash.
 
Apparently there was a silent update to the camera app... or camera hardware drivers... over the last couple of days. Perhaps the torch flash mode has been enabled as a consequence? Bears looking into.
Actually, there was not an update. The camera started working due to a time related software bug - the same bug will cause it to stop working again in 24 days (unless a fix is pushed OTA).
 
Has anyone got it to fire the flash in your own application under any circumstance? (e.g. actually taking a picture)

edit:
Just after I posted this... I actually got a flash.

you got a flash by simulating taking a picture with code?
 
I actually have something WORKING! Still have some issues to work through, but I have a consistent LED Light. Well almost consistent :)

Using FLASH_MODE_ON.
 
I'm pulling for y'all on this one. That dual LED would blow every other mobile flashlight out of the water.

As for battery life--I only ever use the flashlight for 5 or 10 seconds at a time; 20 minutes sounds like an eternity!
 
So the big issue so far is getting a nice constant light instead of it cutting off every couple of seconds and then coming back. I think I can improve it with some careful timing instead of the hack I am using right now. Unfortunately there doesn't seem to be direct access to just turn on the LEDs.
 
So the big issue so far is getting a nice constant light instead of it cutting off every couple of seconds and then coming back. I think I can improve it with some careful timing instead of the hack I am using right now. Unfortunately there doesn't seem to be direct access to just turn on the LEDs.

are you focusing? or taking pictures? Also, are you doing an app or a widget? I was doing a widget. I was wondering if that's why mine wasn't working. I was planning on moving the code to an Activity to test it.
 
Yeah, i thought there might be some success looping through a routine that continually fires commands to auto focus with the flash mode set to Auto. When the sensor detects darkness, it fires the flash so the auto focus can function properly (and so the shooter can see whats being focused on). Obviously, this will be inferior to an application that can use the built in functionality to just keep the flash on natively.

Ideally, we'd like to have access to the LED's without having to fire up the camera and burn through the battery.
 
Yeah, i thought there might be some success looping through a routine that continually fires commands to auto focus with the flash mode set to Auto. When the sensor detects darkness, it fires the flash so the auto focus can function properly (and so the shooter can see whats being focused on). Obviously, this will be inferior to an application that can use the built in functionality to just keep the flash on natively.

Ideally, we'd like to have access to the LED's without having to fire up the camera and burn through the battery.

Even if the Motorola updates the phone to include the missing flash mode that we need, we will still need to "use" the camera, since the only access to the LED flash is through the camera. I guess Google could update Android to handle the camera LEDs differently, but I don't see them doing that.
 
True... though in that case you could just... well... use the camera and not an external app.

Just because they expose the torch flash mode doesn't mean the camera app will support it. Also, just because you are "using" the camera to turn on the LEDs doesn't mean you can't build your interface around controlling the light.
 
Back
Top Bottom