1

Possible Duplicate:
Turning on camera flash LED in Android?

I need to turn on the flash LED in my app, and cannot find any simple methods. How would I go abouts doing this? I just need a sample code to turn on the LED. I do not want it to toggle.

Community
  • 1
  • 1
t3hcakeman
  • 2,289
  • 4
  • 25
  • 27

1 Answers1

0

The Camera parameters can be set to "Torch Mode", but as you probably know it might not work on all devices/OS versions.

Hope this question helps: Camera.Parameters.FLASH_MODE_TORCH replacement for Android 2.1

Community
  • 1
  • 1
ubzack
  • 1,878
  • 16
  • 16
  • Didn't help, getParameters and setParameters were unfound symbols. Any other option? – t3hcakeman Feb 06 '12 at 23:30
  • Are you sure you have an instance of Camera set up? That you got from public static Camera open()? http://developer.android.com/reference/android/hardware/Camera.html#open(int). getParameters and setParameters have been methods on Camera since API level 1, but maybe you're not using an instance of a camera. – ubzack Feb 06 '12 at 23:49
  • This did not work, just caused a crash. Any other easy methods? – t3hcakeman Feb 07 '12 at 14:06
  • @t3hcakeman There is no easy way to reliably switch on the camera's LED light on all phones. There are quite a few phones, which need special handling to turn on the LED. Some pointers: http://stackoverflow.com/questions/5503480/use-camera-flashlight-in-android?lq=1 and http://stackoverflow.com/questions/6068803/how-turn-on-camera-flash-light-programmatically-in-android – AgentKnopf Jan 02 '13 at 07:36