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

FlashLight that uses Camera Flash

It was in a previous thread but it seems to have found its way to the back of the bunch so I will leave this up so people can learn about the app because with the droid camera sucking so much right now (focus wise) atleast we can have some good use for that insane dual LED.
 
Hey guys, just an idea, but perhaps we can collaborate? Care to share your code, and then we can put it on the market as a joint venture? It'll be OUR project.

Just an idea. And we can use google wave somehow to work on it? I'm new to wave, but it looks like it has potential.
 
From what 1033 said, it seems like the Droid does not currently support the necessary flash mode (so called "torch") for this to be possible.
 
Actually, I believe he meant the exact opposite conclusion. The API supports it. Its an implementation thing we have to work out, and if we shared the code it might be much easier to do. I have a feeling I'm pretty close with a barebones app, but I am still learning the syntax. Luckily, it seems to be modeled right after Java.

I'm certain I can get the app working, I just need a little guidance.
 
I agree that the API supports it, but that doesn't necessarily mean the Droid hardware/drivers support it. I think the whole point of calling getSupportedFlashModes() is to identify which modes the current hardware supports.

Anyway, has anyone gotten a chance to try it on the hardware? I didn't have time last night...
 
I agree that the API supports it, but that doesn't necessarily mean the Droid hardware/drivers support it. I think the whole point of calling getSupportedFlashModes() is to identify which modes the current hardware supports.

Anyway, has anyone gotten a chance to try it on the hardware? I didn't have time last night...

I am trying it right now. I can get access to the camera (I hear the 3 clicks just like when you open the camera), but can't get the flash to turn on.

This is the code I am trying...

Code:
camera = Camera.open();
 parameters = camera.getParameters();
 List<String> list = parameters.getSupportedFlashModes();
 
 if (list != null)
 {
	 /*for(int i = 0; i < list.size(); i++)
	 {
		 Toast.makeText(context, list.get(i), Toast.LENGTH_LONG).show();            		 
	 }*/
	 
	 parameters.setFlashMode(Camera.Parameters.FLASH_MODE_ON);
	 camera.setParameters(parameters);
	 camera.startPreview();
	 Toast.makeText(context, "LED IS ON", Toast.LENGTH_SHORT).show();
 }

I just added the startPreview() to see if it helped, but it didn't.
 
Yeah, I doubt using the HILEDs will kill the battery that fast - but it will surely take a toll on overall battery life every time it is enabled.
 
Won't this kill the battery in like 20 minutes? or less ?
Doubt it... but who would have their LED's on for that long? I had an app on my old WM phone that turned the LED on - it would automatically turn it off after 120 seconds.
 
Hope this app comes to market!! That screen LCD light is crap, but we have a DUAL led flash, it would be awesome to get that baby cranking as a flashlight! Wish i could help figure out the code but i'd be useless!! lol. Good luck gang!
 
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.
 
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.

I was thinking the same thing. I will be trying this out in a little while. Left my USB cable at home. running home for lunch to pick it up.
 
When its on Auto, it fires the flash for a few seconds in dark situations while it auto-focuses. I'm wondering if there's some way to leverage that. Is there an event that fires when auto focus is complete? is there a way to force it to keep retrying? Just some thoughts... though that would probably burn through the battery quickly while you're forcing the camera to keep retrying.
 
Back
Top Bottom