How to use camera flash/led as torch on a Samsung Galaxy Tab?

You aren’t doing anything wrong. In fact, you are doing everything correct. You are encountering a Device-Specific issue that is very prevalent in the Android world. I have found the following behavioral patterns for FLASH_MODE_TORCH: Works fine in all cases Works fine, but not with autofocus on Doesn’t work at all Frustratingly, getSupportedFlashModes() will return … Read more

Can I change the LED intensity of an Android device?

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 … Read more

LED flashlight on Galaxy Nexus controllable by what API?

What I found out is that some devices need a SurfaceView to turn on the LED. SurfaceView preview = (SurfaceView) findViewById(R.id.PREVIEW); SurfaceHolder mHolder = preview.getHolder(); mHolder.addCallback(this); Camera mCamera = Camera.open(); mCamera.setPreviewDisplay(mHolder); // Turn on LED Parameters params = mCamera.getParameters(); params.setFlashMode(Parameters.FLASH_MODE_TORCH); mCamera.setParameters(params); mCamera.startPreview(); … // Turn off LED Parameters params = mCamera.getParameters(); params.setFlashMode(Parameters.FLASH_MODE_OFF); mCamera.setParameters(params); mCamera.stopPreview(); mCamera.release(); … Read more