by Patrick Corgan
Version 1 (October 1, 2023)
Download (152 downloads)
An example of how to programmatically get and set the flashlight brightness.
Tested on Samsung Galaxy J7 on Android 8.1, and Samsung A03 on Android 13. Other brands, models, or Android versions may have different valid values for brightness; these can be set in the 'brightness' variable in block 4. If you change the variable, keep in mind that the keys should be incremented and continuous starting at 1; and the values should be in order of least bright starting at key 1, getting brighter as the keys get higher. If the 'brightness' variable is set up correctly, the rest of the flow will take care of itself.
------------------------------
𝘉𝘺 𝘗𝘢𝘵𝘳𝘪𝘤𝘬 𝘊𝘰𝘳𝘨𝘢𝘯
🛠️𝕔𝕠𝕞𝕞𝕖𝕟𝕥𝕤 𝕒𝕟𝕕 𝕔𝕣𝕚𝕥𝕚𝕔𝕚𝕤𝕞𝕤 𝕨𝕖𝕝𝕔𝕠𝕞𝕖⚒️
------------------------------
5 stars | 2 | |
4 stars | 0 | |
3 stars | 0 | |
2 stars | 0 | |
1 star | 0 | |
Reports | 0 |
Rate and review within the app in the Community section.