Based on everything I’ve been reading, there is no way to get the current battery life in a Windows Phone device.
Does anyone know if it is possible to just get the information from the top header (where signal, clock and battery meters are displayed) to show in an app?
The app I am working on doesn’t need to be full screen, but since I have an option to disable user idle detection (it’s a timer app) it’d be nice to see the battery information so one knows if the battery is running low.
You can try what this guy from XDA forums is doing, his app is called Mango Battery Status and is currently doing what you need.
That app is not with source code included, but it uses another XDA project, the Dll Import project. This project is the one that is using to get the battery status.
The Dll Import project is available with full source code.
I hope its helps.