2
Pins

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

published 678 days, 5 hours, 40 minutes ago posted by nehaguptanehagupta 679 days, 14 hours, 9 minutes ago
Friday, June 15, 2012 3:37:11 PM GMT Thursday, June 14, 2012 7:08:27 AM GMT

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.FLASHMODETORCH); camera.setParameters(p); camera.startPreview(); 2. Turn off camera = Camera.open(); Parameters p = camera.getParameters(); p.setFlashMode(Parameters.FLASHMODEOFF); camera.setParameters(p); camera.stopPreview(); And, put following permission on AndroidManifest.x...

category: Smart Client | clicked: 2 | | source: www.mkyong.com | show counter code
tags: Android, camera, flashlight, led, off, on, turn


To post comments using your Facebook,Twitter, Gmail etc credentials in the Discus comments section. Or use your Javapins credentials at the end of the page.
To post your comment as a Javapins user please login or signup to Javapins database.