Battery Manager is very easy to use, you can take dependency of public client actions and can use according to your logic on runtime.
It has below four public client actions -
GetBatteryChargeLevel - A number representing the system's battery charge level scaled to a value between 0 and 100.
GetChargingStatus - Returns a boolean value indicating whether the battery is currently being charged.
GetChargingTime - Return Infinity or a number representing the remaining time in seconds until the battery is fully charged, or 0 if the battery is already fully charged.
GetDischargingTime - Return Infinity or a number representing the remaining time in seconds until the battery is completely discharged and the system suspends.