Search code examples
iphoneobjective-cplistbattery

Finding Capacity Remaining In An iPhone Battery


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??


Solution

  • 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.