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
7
votes
2 answers

Turn ON / OFF Flashlight using SurfaceView

I am writing an Android Camera App and trying to implement Flash functionality, I am using SurfaceView, whenever i do tap on flash button toggle works but flash not coming... see my below code i have used to Turn ON/OFF Flashlights. Complete…
Sun
  • 6,768
  • 25
  • 76
  • 131
7
votes
4 answers

Flash light not detected

I am trying to write an app which turns on flash light when a button is pressed. The problem is the app is not detecting flash light on my phone. I have searched alot on internet. Sure others have faced the problem, I have also applied those…
user2498079
  • 2,872
  • 8
  • 32
  • 60
6
votes
3 answers

Android: Keep camera-LED on after screen turns off

since i'm at the beginning with Android coding i hesitated to post my question, but now i'm at the point where i can't resist. I have a service which turns on the camera-LED onCreate: @Override public void onCreate() { // make sure we don't…
stefanjunker
  • 367
  • 4
  • 13
6
votes
1 answer

What is the use of android.permission.FLASHLIGHT?

I'm developing a flashlight app using Camera 2 API. Every thing works fine. While developing the app I came across quite a few tutorials and even posts from stack-overflow where people have used "android.permission.FLASHLIGHT" permission. I tried to…
Partha Roy
  • 107
  • 1
  • 1
  • 4
6
votes
4 answers

Flashlight Camera2 API

Can I use camera preview and flashlight at the same time in Android Camera2 API? When I try use CameraManager.setTorchMode(String cameraId, boolean enabled) it's work fine when camera is not opened. But when Camera is open and I try setTorchMode I…
user3579059
  • 285
  • 1
  • 5
  • 11
6
votes
4 answers

Is there any way to release a camera from different activity after acquiring it from a different activity.?

I am developing a flashlight App in which there is a normal flashlight in one activity and strobe light in one activity. Now I am acquiring the camera in onCreate of Flashlight activity. But when I am oving to strobe activity, i need to release the…
Aishvarya Jaiswal
  • 1,793
  • 6
  • 34
  • 72
5
votes
1 answer

How do I select the right camera to turn on the flashlight, in Android 2.2?

my problem is that I'm trying to learn about the camera, and right now I have made an app that can turn on the Flashlight on my HTC Wildfire, my Wildfire runs Android 2.2. Heres the code I'm using: //Flash portion camera = Camera.open(); parameters…
André
  • 51
  • 2
5
votes
2 answers

Turn flashlight on/off In QRcodeScanner React native

im using react-native-qrcode-scanner and what i want to do is : when user press on a flashlight icon flashLight go on i done this :
5
votes
2 answers

Controling Android's front led light

I'm trying to implement a 1 second red blinking at the front led whenever the user presses a certain button. But I'm having trouble finding documentation, tutorials or even code-examples on how to access and work with the front led (by that I mean…
elanonrigby
  • 479
  • 1
  • 6
  • 14
5
votes
1 answer

Can't start iPhone X flash in touch mode

I have problems with running iPhone X flash in torch mode. Back AVCaptureDeviceTypeBuiltInTelephotoCamera selected as capture device: com.apple.avfoundation.avcapturedevice.built-in_video:2' - AVCaptureDeviceTypeBuiltInTelephotoCamera After…
lazarev
  • 839
  • 10
  • 25
5
votes
1 answer

LED flashlight on xperia Z5

I am using following code to turn LED flashlight on and off: public Flashlight(SurfaceView preview, Context context){ this.preview = preview; this.context = context; mHolder = preview.getHolder(); //mHolder is surfaceHolder …
horin
  • 1,664
  • 6
  • 23
  • 52
5
votes
0 answers

Where is the source code for the Flashlight toggle in Android 5.1

I created a Flashlight app a while back before Android 5.0 was released. I recently bought a Nexus 6 and the app does not crash but the LED flashlight won't turn on. After searching around, I believe it is because it is manufactured by Motorola…
Trevor M
  • 191
  • 1
  • 6
5
votes
3 answers

How to turn on flashlight and front camera at the same time in android

In one of the requirement in my app I need to pop up an activity containing the front camera preview,at this same time I need to turn on the flashlight as well.However I observe that,I am able to turn on the flashlight and back camera but not front…
Basher51
  • 1,319
  • 1
  • 17
  • 28
5
votes
1 answer

How can I release the camera when another application requests it?

I have two applications that both use the camera: A flashlight app I have developed The camera app The flashlight app opens the camera, turns on the flash, and runs in the background. However, if you start the camera app while the flashlight is…
Alex
  • 51
  • 1
  • 3
5
votes
3 answers

How to test android app that uses flashlight?

I'm currently developing an app for android that uses the flash. My miserable problem is that I don't have a device featuring a flashlight... Is there any emulator in the world that shows the flash state? Thank you guys in advance! José.
jpaguerre
  • 1,130
  • 1
  • 13
  • 20
1
2
3
24 25