I’m using Nexus S Android 2.3 stock version. Whenever I’m trying to set the flash to torch mode:
if (camera == null) {
mCamera = camera = Camera.open();
}
final Parameters params = camera.getParameters();
params.setFlashMode(MODE_TORCH);
camera.setParameters(params);
nothing happens, the flash is not working at all. This piece of code works perfectly on nexus one.
I’ve found this – How to use camera flash/led as torch on a Samsung Galaxy Tab? and also this one – http://forum.xda-developers.com/showthread.php?t=923786 none of them seems to help.
Any idea what am I missing ?
This will work on android 2.3. To work on android 2.3 and 4.0.3 you will have to play with surfaceView and surfaceHolder.