Back

IsCharging

JS Py
Hello World

Checks if phone is currently charging or not.

app.IsCharging() → Boolean

See Also: GetBatteryLevel, GetChargeType

Example - Check Charging State

function OnStart()
{
    var charging = app.IsCharging();
    app.Alert( charging, "is charging:" );
}
from native import app

def OnStart():
    charging = app.IsCharging()
    app.Alert(charging, "is charging:")
    Copy     Copy All       Run