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 (4)

  1. Saad Mahmood says:

    Amazing !

  2. This dll is in win8 sdk or have to download from somewhere else?

  3. 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?

  4. dean says:

    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? http://www.help.com