I ran several long-term battery tests using Developer >> Logging for Energy Diagnostics. I’ve sent them all into instruments where I am able to determine the “Energy Usage Level”. However, is it possible to also get the battery percentage at that moment instead of the “Energy Usage Level”.
I was hoping to be able to graph the battery life percentage over time during the application running, along with determining when my application woke from sleep or turned on GPS.
The testing was done on an iPhone 4, iOS 5.0.1.
Powergremlin doesn’t do exactly what you’re looking for, but it is open source so might start you on the way to implementing it yourself.