PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Battery
  • Management of errors
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
SysPowerStatus
In french: SysEtatAlimentation
Used to get various information about the battery (main or secondary) of the device on which the application is running.
Example
// Status of main battery?
Info("The battery is loaded at: " + SysPowerStatus(ChargePercentage) + " %")
Syntax
<Result> = SysPowerStatus(<Type of information> [, <Battery>])
<Result>: Integer or boolean according to the type of information
  • Requested information,
  • Empty string ("") if the requested information is not available.
<Type of information>: Integer constant
Specifies the type of requested information:
Charging
  • True if the battery is charging,
  • False otherwise.
ChargeLevelCharge level of battery:
  • 0: battery not found.
  • 1: high level.
  • 2: low level.
  • 3: critical level.
ChargePercentagePercentage of battery load.
ACLineStatus
  • True if the device is plugged in,
  • False otherwise.
<Battery>: Optional boolean
  • True (by default) to get information about the main battery of device,
  • False to get information about the secondary battery of device.
Versions 23 and later
AndroidAndroid Widget No information can be retrieved about the secondary battery. If <Battery> is set to False, <Result> will correspond to an empty string ("").
New in version 23
AndroidAndroid Widget No information can be retrieved about the secondary battery. If <Battery> is set to False, <Result> will correspond to an empty string ("").
AndroidAndroid Widget No information can be retrieved about the secondary battery. If <Battery> is set to False, <Result> will correspond to an empty string ("").
Remarks

Battery

  • Versions 23 and later
    AndroidAndroid Widget No information can be retrieved about the secondary battery.
    New in version 23
    AndroidAndroid Widget No information can be retrieved about the secondary battery.
    AndroidAndroid Widget No information can be retrieved about the secondary battery.
  • The returned information is invalid in emulator mode.

Management of errors

Caution: SysPowerStatus returns no error code. To determine if this function has generated an error, use ErrorInfo with the errMessage constant.
Business / UI classification: Business Logic
Component: wd270android.aar
Minimum version required
  • Version 23
Comments
Click [Add] to post a comment