Class AndroidBatteryService

java.lang.Object
com.gluonhq.attach.battery.impl.AndroidBatteryService
All Implemented Interfaces:
BatteryService

public class AndroidBatteryService extends Object implements BatteryService
  • Property Summary

    Properties
    Type
    Property
    Description
    javafx.beans.property.ReadOnlyFloatProperty
    Returns a property that will be frequently updated to reflect the current battery level.
    javafx.beans.property.ReadOnlyBooleanProperty
    Returns a property that will be updated to reflect whether the device is plugged in to an external power source or not.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    javafx.beans.property.ReadOnlyFloatProperty
    Returns a property that will be frequently updated to reflect the current battery level.
    float
    Gets the value of the property batteryLevel.
    boolean
    Gets the value of the property pluggedIn.
    javafx.beans.property.ReadOnlyBooleanProperty
    Returns a property that will be updated to reflect whether the device is plugged in to an external power source or not.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Property Details

    • batteryLevel

      public javafx.beans.property.ReadOnlyFloatProperty batteryLevelProperty
      Specified by:
      batteryLevelProperty in interface BatteryService
      Returns:
      A property containing the current battery level.
      See Also:
    • pluggedIn

      public javafx.beans.property.ReadOnlyBooleanProperty pluggedInProperty
      Specified by:
      pluggedInProperty in interface BatteryService
      Returns:
      A property containing the plugged-in status of the device.
      See Also:
  • Constructor Details

    • AndroidBatteryService

      public AndroidBatteryService()
  • Method Details

    • getBatteryLevel

      public float getBatteryLevel()
      Gets the value of the property batteryLevel.
      Specified by:
      getBatteryLevel in interface BatteryService
      Property description:
      Returns:
      A float value between 0 and 1 to indicate battery charge levels.
    • batteryLevelProperty

      public javafx.beans.property.ReadOnlyFloatProperty batteryLevelProperty()
      Description copied from interface: BatteryService
      Returns a property that will be frequently updated to reflect the current battery level.
      Specified by:
      batteryLevelProperty in interface BatteryService
      Returns:
      A property containing the current battery level.
      See Also:
    • isPluggedIn

      public boolean isPluggedIn()
      Gets the value of the property pluggedIn.
      Specified by:
      isPluggedIn in interface BatteryService
      Property description:
      Returns:
      Returns true to indicate power is coming from an external source, and false to indicate that the battery is powering the device.
    • pluggedInProperty

      public javafx.beans.property.ReadOnlyBooleanProperty pluggedInProperty()
      Description copied from interface: BatteryService
      Returns a property that will be updated to reflect whether the device is plugged in to an external power source or not.
      Specified by:
      pluggedInProperty in interface BatteryService
      Returns:
      A property containing the plugged-in status of the device.
      See Also: