PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Battery
  • Managing errors
  • Various
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
PowerStatus (Function)
In French: EtatAlimentation
Used to get various information about the main or secondary battery on the device where the application is run
Versions 23 and later
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
iPhone/iPad This function is now available for the iPhone/iPad applications (from version 230042).
New in version 23
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
iPhone/iPad This function is now available for the iPhone/iPad applications (from version 230042).
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
iPhone/iPad This function is now available for the iPhone/iPad applications (from version 230042).
Example
// Status of main battery?
Info("The battery is loaded at: " + PowerStatus(ChargePercentage) + " %")
Syntax
<Result> = PowerStatus(<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 connected to the mains,
  • False otherwise.
RemainingLifeRemaining lifetime (in seconds) of battery.
Versions 23 and later
AndroidAndroid Widget iPhone/iPad This constant is not available.
New in version 23
AndroidAndroid Widget iPhone/iPad This constant is not available.
AndroidAndroid Widget iPhone/iPad This constant is not available.
TotalLifeTotal lifetime (in seconds) of battery.
Versions 23 and later
AndroidAndroid Widget iPhone/iPad This constant is not available.
New in version 23
AndroidAndroid Widget iPhone/iPad This constant is not available.
AndroidAndroid Widget iPhone/iPad This constant is not available.
<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

  • Windows Mobile Depending on the Mobile Device (Pocket PC) used, some information is not returned.
  • Windows Mobile Some Mobile Devices are not equipped with batteries.
  • 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.
  • Versions 23 and later
    AndroidAndroid Widget iPhone/iPad The returned information is invalid in emulator mode.
    New in version 23
    AndroidAndroid Widget iPhone/iPad The returned information is invalid in emulator mode.
    AndroidAndroid Widget iPhone/iPad The returned information is invalid in emulator mode.

Managing errors

Caution: PowerStatus returns no error code. To find out whether an error was generated by this function, use ErrorInfo associated with the errMessage constant.
Windows Mobile

Various

To find out the status of battery on the Mobile Device connected to the PC in a WINDEV application, use cePowerStatus.
Components
Windows Mobile wp230ce.dll
Android wd230android.jar
Minimum required version
  • Version 9
Comments
Click [Add] to post a comment