views:

1021

answers:

2

Does anyone know how (if possible) I can find out how much capacity (mAh) is remaining in an iPhone battery at any given time?

alt text

Something like the program above?

Is there a value stored in a plist somewhere??

+2  A: 

couple ways,

to gauge the mAh you could check the battery level over time using that method.

3.0 has added an event to do that:

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(batteryChanged:)
name:@”UIDeviceBatteryLevelDidChangeNotification” object:device];

in general, measuring the open circuit voltage or current is used to gauge the state of charge by the hardware. the capacity of the bat will shrink over time, so 100% will indicate no more charge can be stored, even tho the capacity is lower than a new iphone battery.

jspcal
Thanks for the response but I am using the pre 3.0 sdk method at the moment and this returns the percent of charge remaining. I want to know mAh left i.e 750mAh. Any ideas?
Stumf
Does the iPhone automatically re-calibrate and display an appropriate percentage depending on the age of your battery?
Stumf
Thanks for that I understand much better now!
Stumf
+1  A: 

The UIDevice API includes a property relating to battery level.

NickFitz