How to make android phone flashlight blink

0 votes

I'm attempting to use binary code to control the android phone's LED flashlight so that it will turn on and off depending on the value of a character.

if ( char == '1'){ params.setFlashMode(Parameters.FLASH_MODE_ON); }              
if ( char == '0'){ params.setFlashMode(Parameters.FLASH_MODE_OFF);}

Consequently, I get the char from a String str ="101010101"; the char receives the values 1, 0, 1, and so on, and is supposed to cause the flashlight to blink, but all it does is blink one after another. How should I resolve this issue? Thanks

Nov 25, 2022 in Android by Edureka
• 13,620 points

edited Mar 4 1 view

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP