termux-api
termux-api copied to clipboard
Built-in BATTERY_PROPERTY_CAPACITY and BATTERY_PROPERTY_CHARGE_COUNTER
BATTERY_PROPERTY_CHARGE_COUNTER can be multiplied with EXTRA_VOLTAGE in #623 to obtain the remaining battery energy, while BATTERY_PROPERTY_CAPACITY is available since API level 21, without requiring Termux to calculate the battery percentage by itself.