Click button set screen brightness help

rfresh

Well-Known Member
Licensed User
Longtime User
I'm new to B4A and I'm starting out with writing a simple app with a button when clicked will set the screen brightness at 50%.

I have
Dim phone1 As Phone
in Process_Globals

but I'm getting a compiler err complaining about
Error description: Unknown type: phone
Are you missing a library reference?

How and where do I add the Phone lib module?

Also, in my button click event I have
phone1.SetScreenBrightness(50/255)

Is this correct? I wonder why the argument has that /255?

Thanks...
 

rfresh

Well-Known Member
Licensed User
Longtime User
My statement
phone1.SetScreenBrightness(50/255)

seems to set the brightness to about 50% when I click on my button. I changed the value to 10 and to 90 and those values seem to set the brightness accordingly.

However, when I close my app, the screen brightness is back to what it was before I started up my app and changed it. For example, I manually set brightness to 100 in setup manually. Then I start my little app and set it to 10 and close the app. The screen is still bright.

Is there a trick to setting the brightness and having it 'stick' after closing my app?
 
Upvote 0
Top