Class AndroidBatteryService

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javafx.beans.property.ReadOnlyFloatProperty batteryLevelProperty()
      Returns a property that will be frequently updated to reflect the current battery level.
      float getBatteryLevel()
      Returns the current battery level of the device as a float between 0 and 1 (inclusive), where 0 indicates the battery is completely empty, and 1 indicates that the battery is fully charged.
      boolean isPluggedIn()
      A boolean representing whether the device is currently receiving power from an external source (i.e.
      javafx.beans.property.ReadOnlyBooleanProperty pluggedInProperty()
      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
    • Constructor Detail

      • AndroidBatteryService

        public AndroidBatteryService()
    • Method Detail

      • getBatteryLevel

        public float getBatteryLevel()
        Description copied from interface: BatteryService
        Returns the current battery level of the device as a float between 0 and 1 (inclusive), where 0 indicates the battery is completely empty, and 1 indicates that the battery is fully charged.
        Specified by:
        getBatteryLevel in interface BatteryService
        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.
      • isPluggedIn

        public boolean isPluggedIn()
        Description copied from interface: BatteryService
        A boolean representing whether the device is currently receiving power from an external source (i.e. it is not running on battery power).
        Specified by:
        isPluggedIn in interface BatteryService
        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.