Android Question Change brightness without permissions

shauny6983

New Member
Licensed User
Similar to how Netflix works with brightness, or a loyalty app that brightens the screen temporarily when showing a QR code, neither of these require permissions to achieve. I'd like to have this functionality but cannot work out how to implement this in B4A. (I'd also like this in B4i if possible)

I've found this guide for Android, but I cannot translate. Can someone please help?
https://androidacademic.blogspot.com/2023/03/change-android-screen-brightness.html

I would be using it to show a QR code with temporary brightness.
Thank you
 

klaus

Expert
Licensed User
Longtime User
You can set the screen brightness with the Phone library.
B4X:
Private p As Phone
p.SetScreenBrightness(0.5)
The brightness value is a float number from 0 to 1.
You could have a look at this post.
 
Upvote 0
Top