Partager via


Windows Phone 8 : Identify Battery Status

A very simple and much required API addition in Windows Phone 8 which allows you to retrieve Battery related information. Here’s what this API expose,

- Identify remaining battery percentage

- Discharge time

- An event that triggers when battery percentage drops by 1% 

Battery class is contained within namespace Windows.Phone.Devices.Power

Here’s how you can identify remaining battery percentage,

Battery.GetDefault().RemainingChargePercent

Note that this feature wasn’t supported in Windows Phone 7.5 earlier and makes a comprehensive addition to WP8 SDK.

 

(With above article in place, we are rolling a new strategy to share a concise article on weekend to keep the tech. guys up and running)

Comments

  • Anonymous
    February 16, 2013
    Amazing !

  • Anonymous
    February 16, 2013
    This dll is in win8 sdk or have to download from somewhere else?

  • Anonymous
    February 20, 2013
    Given that Windows Phone 8 and Windows 8 are two different platforms, this API is part of the native Windows Phone 8 SDK experience. Hope that answers?

  • Anonymous
    March 06, 2015
    Given that Windows Phone 8 and Windows 8 are two different platforms, this API is part of the native Windows Phone 8 SDK experience. Hope that answers? www.help.com