How to turn on the front flash on Android

How to programmatically enable the front flash in Android?

if not, you can do whatever you want according to your app as needed.

On Checking for flash device availability:

Which will return true if the flash is available, false if not.

To turn the flashlight on/off:

I googled and got this about Android.resolution.PROJECTOR. Android manifest resolution looks promising:

then use camera and set camera.Parameters. The main parameter used here is FLASH_MODE_TORCH.

Code snippet to enable the camera flash.

code snippet to turn off the led light camera.

I just found a project that uses this resolution. Check the src code. here (Note: this link is now broken)

Update6 You can also try to add SurfaceView, as described in this response LED flashlight on the Galaxy Nexus, managed by which API? This seems to be a solution that works on many phones.

update 5 major update

I found an alternative Link (for broken links above): now you can use this link. [Update: 14/9/2012 this link is now broken]

an example showing how to turn on the LED on the Motorola Droid:

update 3 (widget to enable/disable camera led)

If you want to develop a widget that turns the camera led on/off, then you should refer to my answer widget to turn the camera led on/off on Android.

if you want to set the intensity of the light coming out of the camera LED you can refer can i change the intensity of the SEED device android? full post. Note that only HTC root devices support this feature.

there are also some problems when turning on/off the flashlight. e.g. for devices that don’t have FLASH_MODE_TORCH or even if they do, the flashlight doesn’t turn on etc.

you can refer to the problems in the list below:

in my experience, if your application is designed to work in both portrait and landscape orientation, you need to declare cam variables as static. Otherwise, onDestroy. which is called when you switch orientation, destroys it, but does not release the cam, so it cannot be reopened.

to manifest I had to put this line

in API 23 or higher (Android M, 6.0)


people still support my answer, so I decided to post additional code This was my solution to the problem that day:

I got autoflash light with below simple three steps.

Build Run. Now go to the dim light area and link the photo, you should get an automatic flash light if the device supports.

Android lollipop introduced the camera2 API and deprecated the previous camera API. However, using the legacy API to enable flash still works and is much easier than using the new API.

it seems that the new API is intended for use in specialized full-featured camera apps and that its architects have not considered simpler use cases, such as enabling flash. To do this now need to get CameraManager, create a CaptureSession with a dummy surface, and finally create and run CaptureRequest. Exception handling, resource cleanup and long callbacks included!

to see how to enable flashlight on Lollipop and newer, take a look at the FlashlightController in the AOSP project (try to find the newest as well as the older API uses that have been changed). Don’t forget to set the necessary permissions.

Android Marshmallow finally introduced a simple way to turn on the flash with setTorchMode.

full code for android flashlight app

There are different ways to access the camera flash in different versions of Android. Several APIs stopped working in Lollipop, and then it changed again in Marshmallow. To overcome this, I created a simple library that I’ve used in several of my projects, and it gives good results. It’s still incomplete, but you can try to check the code and find the missing parts. Here’s a link. NoobCameraFlash.

If you just want to integrate it into your code, you can use gradle for this. Here are the instructions (taken directly from the Readme).

Add the JitPack repository to the build file. Add it to the root build.gradle at the end of the repositories:

Activating an option on Android

Almost all modern devices running on the Android operating system, have a built-in option that allows you to make a call or receiving notifications triggered LED pulse. To activate the function, perform the following actions:

  • Go to the settings of your smartphone;
  • Select the section “Special features”, then “Advanced settings”;
  • select “Notifications by flash” in this item;
  • Turn on the LED signal for ringing, notifications or alarms.


If after setting the phone, the flash will not work, the causes may be mechanical damage: liquid in the body, blown LED. To fix the flash, try a reset without deleting data.

See also  How to configure e -mail on the Android tablet

If desired, in the same section you can activate the “Screen flash” function. Once it is turned on, the smartphone monitor will blink during an incoming call or SMS, lying on the surface with the screen up.

Activation via system settings

To activate the flash on a call you need to perform the following sequence of operations

  • Android 9. owners of smartphones with this version of the OS from Google Corporation need to download the window with configuration tools, find the item “Special Features”, select the option “Flash notifications” and give the option “Flash” working state.
  • Android 6, 7, 8. first you open the settings window, then select the section with the name “Special Features”. There you press the option “Hearing” and by moving the lever to the active state “Flash Notifications” are enabled.

How to turn on the flash on your phone Samsung a51, a50, a11, a10, a31, m21, a71, a30

All this is done through the settings. So we go there and look for the special features section. Just twist it down until you see it.

turn, front, flash, android

Then you will need to go to additional settings, which will also find no problems.

That’s where you’ll find what we need. the line “Notification by flash“. Found? Great.

We go there, twist the display a little bit down and move the slider to the right. make it active (blue). That’s it.

Interesting things about flash for phones

A few years ago, a phone camera equipped with a flash, was the object of desire of each enthusiast of mobile photography.

Now it is on almost all phones, only it does not have much effect. It’s a diode that supports autofocus.

Only manufacturers are trying to improve the lighting conditions of the frame, and LEDs can not be compared to a traditional flash.

The disadvantage is the need for a large capacitor, which simply has no place in thin smartphones.

Thanks to her latest invention, Professor Lee Pui-Zee, it can now become many times more efficient.

She was able to create a flat condenser made of polymers that stores the charge needed to light a gas with a thickness of only 1 mm.

Manufacturers now have one last challenge: implementing the new solution for mass production.

According to Jack Tuen, CEO of Xenon Technologies, such thin elements could appear on smartphones as early as next year.

It is very likely that the new development will arouse the interest of leading manufacturers, and in the future this type of solution will appear in new models. Good luck.

39 Комментарии и мнения владельцев on “Why does the flash not work in the Android phone and how to turn it on?

I forgot to say hello: I wish you all the best and thank you for this article: everything is very interesting: It was not long before you wrote it, everything is very good, but I want to know when I install a new add-on, I see in it that when I do not start it, it says: The battery has not been consumed since the moment of full charge and for the last three years the add-on has not been called to memory. Also, you wrote that if the add-ons and games will not work in the background mode, even a hundred will not affect the productivity, then tell me, it will not be terrible, If I put all the add-ons I want during the week and will not run them for an hour, and they will not work and the battery will be filled to 57% is not a problem?

No big deal. The Android system is smart and knows what to put to sleep and when to turn off.

Since an answer in Russian I will also answer in Russian, but Ukrainian is closer to me: it’s obvious that the system is smart and knows everything. I do not know if the iPhone is smart or not smart, but it is also what is needed. That’s all for today! Thank you for your consideration! I will probably write the day after tomorrow, because there are still questions. Have a nice day! Bye Bye!

If you have not jailbroken your tablet, but would like to access the selfies feature, you can also use the Take Selfies FREE app. It is intended to create a photo with a FaceTime camera and contains, among other things, settings for the brightness of the screen.

Please tell me why the flash on the phone. does not work in full force, not brightly.And the flashlight doesn’t shine brightly?

Vytannya! I have just on Huawei media pad t3 10, unfortunately, do not have a bedroom, but you write here that you can connect the external power. Where can I get it and can it be connected to my tablet??

The light, connect to your tablet can be switched on. To buy. in a regular store, if available, or on the Internet.

Oh, thank you, you’ve made me so virile. And I thought you can not. Thank you very much and thank you a hundred times over.

Congratulations! I am writing to you from the bottom of my heart, please help me in any way you can: literally yesterday I watched a video about the external sleeping bag: it seems to me that there is a lot of omany about it: on the video the guy plugged the sleeping bag into his Nokia Lumia smartphone, because he also did not have his own original sleeping bag: so: it did not work when he tried to take pictures in the dark and when he just turned on the light: this sleight simply shines on him as a normal motor, and it does not work when taking photos on the rear camera, the package includes the sleight itself and a USB charging cable for connecting: He tried to scan the QR-code, which was on the box, downloaded the program for the bed, entered the program, clicked the bed, but he did not blink on it when taking photos, I know when the phone is taken photos spalah must simply blink once and all, and from the outside does not want to: It can be simply manually driven and driven by pushing on the drive and selecting the power of light and it will shine like a conventional lighter. Yanovny Yaroslavl, if you can give me a concrete instruction on how this bed can be used, I want to buy it for my tablet, Because I wish I had a local one, so I did not buy a pig in a poke, as they say, and that this was a real sleeper which worked as required and blinked when you take photos in the dark? How to correctly configure the phone for the tablet? Please help me!! I wish the photos from the rear camera enter very well in the dark at this time (not selfies)!)

See also  How to turn on a Samsung touch stove

The second way to make the flash blink when calling on an android phone

To enable it, you must equip your phone with the appropriate application, which will allow you to do this.

To do this we will use the free “Flash On Call”. You can install it for free directly from the Market.

After starting the app, the main screen will appear where we can turn on / off the flash notifications for incoming calls and for SMS / MMS. First, activate the app with the “Tap to turn on” button at the bottom.

The first set of options at the top is used to set the flashing of an incoming call. Select from the list for which volume profiles should flash (normal, vibrate, and silent), and use the sliders to set the flash speed and number of flashes (flashes per interval).

A similar set of options can be found just below under “SMS and MMS”. Here you can activate the flashing light for SMS and MMS messages, as well as set the number of flashes to receive the message.

From now on, when someone calls us or sends us an SMS, our Android will notify you not only with sound and vibration, but also with a flash.

Flash settings on your phone

Find the camera app on your phone. As a rule, the pre-installed camera app looks like a blue camera app:

Open that app. Find the lightning icon. If it’s crossed out, the flash is off:

Click on the lightning icon once. Most likely it will change to a lightning icon with an “A” next to the bark. You may have already had this particular setting activated. What it means? This means that the flash will go off automatically, at the phone’s discretion. If the device thinks it’s dark, the flash will go off, if the phone doesn’t think so, it won’t do it. Except that the opinion on the sufficiency of light may not coincide with the owner of the phone and the phone itself:

If you want a flash that will always go off when you take a photo or record a video, the icon should be a lightning bolt. It may be yellow in color. This tells you that the function is on and that the flash will turn on as soon as you take a photo or a video. When you are shooting a video, the backlight is on all the time:

Another issue is when you use some other app. For example. Instagram:

Here, the flash on and off function may have a different shape, but that said, it’s also a lightning bolt icon:

Important to know! Each separate app that has a photo and video function is a separate app with its own design. So the lightning icon can be in different corners of the monitor and have a variety of designations. But, most often, it is the “Lightning” icon.

If after all the turning on and off the flash on your phone still does not work, there may be a problem:

It may help to simply reboot your smartphone if you haven’t tried that yet.

Using third-party apps, such as Flash to Call

Download and install “Flash on call and SMS” application from Play Market. With it you can set the camera flash to notify you of incoming calls, new messages or any other notification. The app is absolutely free. Plus, its functionality isn’t just limited to setting up a flash for notifications. The only downside is the advertising that keeps popping up, but thanks to the options available, you can put up with it.

As soon as you run the app for the first time, it will automatically activate flash notifications. In the app settings you can specify for which contacts the flash will be used for notifications. There are quite a few settings, so you can easily customize your flash notification. You will also be able to adjust the gap between flashes and the intensity of their flicker, and all changes can be tested using the test mode.

See also  How to create Apple ID without a credit card

If you want, you can use “Flash on Call” to set which apps you want your flash to notify you of. To do this, click on the “Select Application” slider in the “Flash Notifications” section. This will take you to a menu with a list of applications for notifications from which you can use the rear camera flash.

You can also specify the charge level at which this feature will turn off completely by clicking on “Battery Percent” under “Battery Threshold”. This way you can extend the life of your smartphone if you’re constantly getting calls.

In addition, you can set the flash to work for notifications when “Do Not Disturb” mode is on. You can also choose with which of the sound modes this function will be active: “Ringing”, “Vibration”, “Silent”.

That’s it! With the flash on call app set up, you will no longer miss notifications of calls and messages. Don’t forget to turn off the flash notification feature at night, as the camera flash shines very brightly. We do not think you want to wake up in the middle of the night from a flashing smartphone.

Turning on the flash using free apps

Some models of Android devices do not have the possibility of backlighting during a call. Then the problem is solved with the help of Play Store software. There are several conditionally free programs that allow you to activate the flash for incoming notifications. Their functionality is limited, but for a small surcharge is the possibility of expanding it.

Flash on call. the application program allows, in addition to the standard melodies, to apply for notification flicker built-in camera. By installing it on a smartphone running on the Android system, the user receives an activated LED signal. Additionally, this program solves the following tasks:

  • The use of flicker for reminders;
  • light signal when you need to charge the battery;
  • activation of flashing notifications remotely, via SMS;
  • Setting different modes of operation of the light indicator.

Call SMS flash alert. free utility with settings in Russian. After downloading it, it is possible to use the notification light not only on incoming calls and SMS messages. The flickering camera signal reacts to notifications from Instagram and popular messengers: Viber, WhatsApp and Skype.

Also often use a simple application Flash alerts 2. It requires a minimum number of permissions. With this tool, you can answer the phone when there is a lot of noise around. The application will benefit while the smartphone is in silent mode when you need a visual alert.

For any mobile devices running on the Android operating system, these programs are downloaded from Play Market. For this purpose enter the required request in the search line. Select a suitable application from the list offered by the virtual service and download it to your device.

Then the program is installed on the phone, performing the following steps in order:

  • The application is launched by pressing the “Test Flash” button.
  • When the light indicator lights up, press “Continue”.
  • In the window that opens, set the basic parameters so that the notification lights are triggered during a call or a notification;
  • Additionally, you can set the option to flash the screen of your smartphone at the same time. To do this, check this box.

Light indicators are connected on phones with different operating systems. Quickly it can be done from the main menu, but for advanced functionality it is better to use free utilities. Even if the internal memory of the device does not allow you to install additional programs, you can put them on a memory card to use your smartphone with comfort. It is not necessary to install several applications at the same time. There will be a conflict and no utility can work properly.

Android 4.1 Other versions of Flash to call and SMS is an app that will help you not miss important calls or messages in silent mode on your smartphone. As soon as someone calls you or sends you a message. your flash will blink immediately, signaling to you to pay attention. Telegram channel of the creator of Treshbox with development insides The application has a very useful and simple interface which allows you to get to work immediately, instead of wasting time trying to understand the interface. You can adjust the flicker rate yourself in the app settings, you can know if you receive a call or a message. make the flicker faster or slower! Main pluses Flash on call and SMS:

  • Put flicker flash on calls and messages!
  • Customize the flicker frequency. make it so that messages can be distinguished from incoming calls!
  • Convenient interis.

Treshbox creator’s Telegram channel with development insights Last modified: September 24, 2019. 09:46

Denial of responsibility | Contacts |RSS | SE | EN | BR | DE