在Windows Phone 8设备中获得电池电量?

时间:2012-08-02 19:01:07

标签: windows microsoft-metro windows-runtime windows-phone-8

如何以编程方式从Windows Phone 8设备获取电池电量?

3 个答案:

答案 0 :(得分:20)

以下为我工作

Windows.Phone.Devices.Power.Battery.GetDefault()。RemainingChargePercent

答案 1 :(得分:2)

快速查看this视频。它超越了你提到的API。

答案 2 :(得分:0)

您可以使用Windows.Phone.Devices.Power名称空间中定义的Battery类检索电池电量和Windows Phone 8设备电池的剩余时间。以下是一些使用示例。

  1. Retreiving the Remaining time of the Windows Phone 8 device battery programatically using C#
  2. How to retreive the Battery Level programatically in Windows Phone 8 ?