This question has already been answered:

I am writing an application that interacts with the flash of the phone. Tell me, what code should I use to start the camera flash (not including the camera itself) for a certain time in milliseconds?

Reported as a duplicate by participants 0xdb , AK , Community Spirit 10 Nov '18 at 13:02 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • Yes, corrected the title - ru38irk
  • one
    Sorry, incorrectly written. Of course, you need code to write a program that would include a flash for a specific time - ru38irk

1 answer 1

here in this question, on this resource, there is a complete answer to your question: how to add a flashlight to my application

  • thanks, it's almost that. you need the flash to automatically turn off after a certain time (which I could set programmatically) - ru38irk
  • 'TimeUnit.SECONDS.sleep (1);' use a similar timer - Dev Azmandios