1

I'm attempting to run a timed Background Task in a Windows Universal app. In the Background Task, I'd like get some details about the user's phone, including remaining battery charge percent. It appears that the only way to access Battery info is through the Windows.Phone namespace, which is unavailable to a Windows Runtime component.

So far, I've tried some unconventional things, including adding a public static object property to the Background Task class, which I'd set to a reference to the Battery, and then retrieve information from via Reflection. This fails, because the reference is invariably null at runtime.

Is there any way to get battery information in a Background Task in a Universal Windows App?

PingZing
  • 942
  • 5
  • 20
  • Sadly, there seems to ne no RT api for that: http://stackoverflow.com/questions/13983746/get-the-battery-status-on-windows-8 (Old Post, but I can't find any news in that regard.) – Kai Brummund Apr 24 '15 at 17:01

1 Answers1

1

Windows Phone 8.1 supports this via the Battery class, but there is no equivalent for Windows 8.1.

Looking forwards, Windows 10 provides a newer Battery class that works across all devices.

Peter Torr - MSFT
  • 11,824
  • 3
  • 18
  • 51