Questions tagged [flashlight]

Most phones (and even tablets) have one or more camera/s. For optimal lighting, a white LED (or more than one) is used to illuminate the scene and act as a flash light.

Most phones (and even tablets) have one or more camera/s. For optimal lighting, a white LED (or more than one) is used to illuminate the scene and act as a flash light.
Some apps use this LED to turn the device into a portable torch.

369 questions
66
votes
15 answers

How to turn flashlight ON and OFF in swift?

I'd like to add flashlight functionality to my app in Swift. How can I go about doing that?
Lachtan
  • 4,803
  • 6
  • 28
  • 34
57
votes
14 answers

android java lang runtimeexception fail to connect to camera service

I am currently working on Flashlight On/OFF. I am getting this error java.lang.RuntimeException: Fail to connect to camera service I don't know why this error is occurring. I referred to many solutions but my problem was still not solved. When…
Jigar Shekh
  • 2,800
  • 6
  • 29
  • 54
53
votes
7 answers

Use camera flashlight in Android

I'm trying to use the cameras LED flashlight in a widget. I've found several threads about this topic (i.e. the one mentioned later..) , now I'm trying to control the light using: Camera cam = Camera.open(); Parameters p =…
pgruetter
  • 1,184
  • 1
  • 11
  • 29
37
votes
5 answers

Can I change the LED intensity of an Android device?

Is there a way to set the LED intensity that I desire? I know that to turn on the LED I use: p.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH); mycam.setParameters(p); But this code just turns on the LED. But is there a way to set…
Buda Gavril
  • 21,409
  • 40
  • 127
  • 196
36
votes
10 answers

How does CameraX library can turn ON/OFF the torch?

I am developing a feature with the possibility of switching the torch into ON/OFF states. Some days ago, we saw a new library from Google in io2019. I came up with an idea, why not use it. After some time, I don't see any possibilities to use the…
24
votes
1 answer

LED flashlight on Galaxy Nexus controllable by what API?

So many LED flashlight API questions for Android. I'm afraid to ask yet another, but here goes.. Using the tried and true FLASH_MODE_TORCH I am able to achieve satisfaction with my Samsung Galaxy SII and get the LED flash turned on. On my friend's…
Malachi
  • 2,260
  • 3
  • 27
  • 40
18
votes
1 answer

Turn ON/OFF Camera LED/flash light in Samsung Galaxy Ace 2.2.1 & Galaxy Tab

I am turning ON Camera LED light using FLASH_MODE_ON. Samsung Galaxy Ace have only three flash modes : on, off and auto. FLASH_MODE_TORCH not working in Samsung Galaxy Tab & Samsung Galaxy Ace 2.2.1 Here is my code how i am turning ON my Camera…
Kartik Domadiya
  • 29,868
  • 19
  • 93
  • 104
13
votes
4 answers

Flashlight control in Marshmallow

I have a problem regarding the camera in the most recent Marshmallow build, more specifically the flashlight. On any pre-Marshmallow version all I need to do to turn the flash on/off was the following: private void turnFlashOn(final Camera camera,…
10
votes
5 answers

How to turn on the Android Flashlight

Update Check out my answer Original I'm trying to turn on the camera flashlight on the LG Revolution within my program. I use the torch mode method which works on most phones but not on LG phone. Does anyone know how to get it to work on LG's or…
MinceMan
  • 7,483
  • 3
  • 38
  • 40
10
votes
3 answers

iOS: Torch level on iPhone 11 Pro

I'm using AVCaptureDevice.setTorchModeOn(level) method to turn on the flashlight at variable brightness. On my old iPhone SE it's working fine — I can clearly see 4 different brightness levels as I change level from 0 to 1. But on the iPhone 11 Pro…
Pavel Alexeev
  • 6,026
  • 4
  • 43
  • 51
10
votes
1 answer

FlashLED intensity controls

I am looking for help in Android camera LED Flash for changing intensity of it like this app. I have checked following link but i am not getting exact result from it. Can I change the LED intensity of an Android device? How to turn on camera flash…
NIKHIL
  • 2,719
  • 1
  • 26
  • 50
9
votes
2 answers

iOS Firebase Flashlight/ElasticSearch Heroku Setup using Node.JS

I'm building an iOS app in Swift with a Firebase backend. I need advanced search options for my app. I've been told I should use Flashlight/ElasticSearch via this github link https://github.com/firebase/flashlight Assume my app's name is…
Lance Samaria
  • 17,576
  • 18
  • 108
  • 256
8
votes
2 answers

LED Flashlight does not work on Samsung Galaxy Nexus

I've got the following problem: My Flashlight app works fine on my Samsung Galaxy S2 but unfortunately not on the Samsung Galaxy Nexus (problem: flashlight ignores the button-click -> no reaction, no light, no crash, no exception). I've read "LED…
CarpeTempus_
  • 712
  • 1
  • 6
  • 10
8
votes
1 answer

Iphone flashlight not working while app is in background

Hi i am using a location based app and wants to use iphone camera flashlight while in background.Unfortunately flashlight is working only in foreground ,it automatically turns off the flash in background even though the code is executing . The code…
Suraj K Thomas
  • 5,773
  • 4
  • 52
  • 64
7
votes
1 answer

Nexus 5 (4.4.2) Flashlight LED not turning on

I wrote a simple flashlight app that I've tested on an HTC Sensation, Nexus 7, HTC One, Moto X, Galaxy S3, Galaxy S4, and a Nexus 5. The only one that it doesn't work on is the Nexus 5. It doesn't throw an exception so finding out what's wrong is…
Zeek Aran
  • 523
  • 4
  • 18
1
2 3
24 25