Android Question Display ON/OFF to save battery

Cesaral

Member
I have an App that captures information from an external source (thru the USP port) for a long time and I need to save battery.

Is there a way to switch OFF the display (or the back light source of the display) to save battery, and by software switch it ON when needed?
 

Quandalle

Member
Licensed User
B4X:
    Dim p As Phone
 
    p.SetScreenBrightness(1.0) ' set Brightness : float value between  0.0 (min) and 1.0 (max)
    ...
    p.SetScreenBrightness(-1)  ' restore automatic Brightness

You ca also use PhoneWakeState
B4X:
    Dim pw As PhoneWakeState
    pw.KeepAlive(False)
 
Last edited:
Upvote 1
Cookies are required to use this site. You must accept them to continue using the site. Learn more…