Showing posts with label LED Flashlight. Show all posts
Showing posts with label LED Flashlight. Show all posts

Wednesday, May 21, 2014

How to turn on/off camera LED / flashlight in Android

In this tutorial, we show you how to turn on/off the phone camera led or flashlight in Android. See code snippets :

1. Turn on
camera = Camera.open();
Parameters p = camera.getParameters();
p.setFlashMode(Parameters.FLASH_MODE_TORCH);
camera.setParameters(p);
camera.startPreview();