AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones específicas para móviles / Funciones de teléfono
  • Battery
  • Handling errors
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Advertencia
A partir de la versión 26, this function is available for backward compatibility. Use the SysPowerStatus function.
Used to get various information about the battery (main or secondary) of the device on which the application is running.
Ejemplo
// Status of main battery?
Info("The battery is charged to: " + EtatAlimentation(ChargePercentage) + " %")
Sintaxis
<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 requested type of information:
ACLineStatus
  • True if the device is plugged in,
  • False otherwise.
ChargeLevelCharge level of battery:
  • 0: No battery.
  • 1: High level.
  • 2: Low level.
  • 3: Critical level.
ChargePercentagePercentage of battery load.
Charging
  • True if the battery is charging,
  • False otherwise.
RemainingLifeRemaining lifetime (in seconds) of battery.
AndroidWidget Android iPhone/iPad This constant is not available.
TotalLifeTotal lifetime (in seconds) of battery.
AndroidWidget Android 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.
AndroidWidget Android No information can be retrieved about the secondary battery. If <Battery> is set to False, <Result> will correspond to an empty string ("").
Observaciones

Battery

  • AndroidWidget Android No information can be retrieved about the secondary battery.
  • AndroidWidget Android iPhone/iPad The returned information is invalid in emulator mode.

Handling errors

Caution: PowerStatus returns no error code. To determine if this function has generated an error, use ErrorInfo with the errMessage constant.
Clasificación Lógica de negocio / UI: Lógica de negocio
Componente: wd300android.aar
Versión mínima requerida
  • Versión 9
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local