# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Constants | Ctors | Methods | Inherited Methods

# BatteryState

`public abstract class BatteryState`
`extends Object` ``

java.lang.Object
↳ | android.hardware.BatteryState

The BatteryState class is a representation of a single battery on a device.

## Summary

### Constants
`int` | `STATUS_CHARGING` Battery is charging.
`int` | `STATUS_DISCHARGING` Battery is discharging.
`int` | `STATUS_FULL` Battery is full.
`int` | `STATUS_NOT_CHARGING` Battery is connected to power but not charging.
`int` | `STATUS_UNKNOWN` Battery status is unknown.

### Public constructors
`BatteryState()`

### Public methods
`abstract float` | `getCapacity()` Get remaining battery capacity as float percentage [0.0f, 1.0f] of total capacity Returns NaN when battery capacity can't be read.
`abstract int` | `getStatus()` Get the battery status.
`abstract boolean` | `isPresent()` Check whether the hardware has a battery.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Constants

### STATUS_CHARGING

    public static final int STATUS_CHARGING

Battery is charging.

Constant Value: 2 (0x00000002)

### STATUS_DISCHARGING

    public static final int STATUS_DISCHARGING

Battery is discharging.

Constant Value: 3 (0x00000003)

### STATUS_FULL

    public static final int STATUS_FULL

Battery is full.

Constant Value: 5 (0x00000005)

### STATUS_NOT_CHARGING

    public static final int STATUS_NOT_CHARGING

Battery is connected to power but not charging.

Constant Value: 4 (0x00000004)

### STATUS_UNKNOWN

    public static final int STATUS_UNKNOWN

Battery status is unknown.

Constant Value: 1 (0x00000001)

## Public constructors

### BatteryState

    public BatteryState ()

## Public methods

### getCapacity

    public abstract float getCapacity ()

Get remaining battery capacity as float percentage [0.0f, 1.0f] of total capacity Returns NaN when battery capacity can't be read.

Returns
`float` | the battery capacity. Value is between -1.0f and 1.0f inclusive

### getStatus

    public abstract int getStatus ()

Get the battery status.

Returns
`int` | the battery status. Value is `STATUS_UNKNOWN`, `STATUS_CHARGING`, `STATUS_DISCHARGING`, `STATUS_NOT_CHARGING`, or `STATUS_FULL`

### isPresent

    public abstract boolean isPresent ()

Check whether the hardware has a battery.

Returns
`boolean` | True if the hardware has a battery, else false.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*