Search code examples
iphonebatteryiokituidevice

iPhone battery capacity values in mAH


I would like to know how to have the data capacity in Mha for iPhone/iPad battery. I would put them in an application that I intend to put on appstore and then I can not use IOKit. Does anyone know how I can get these values?


Solution

  • batteryLevel
    
    The battery charge level for the device.
    @property (nonatomic, readonly) float batteryLevel
    Discussion
    
    Battery level ranges from 0.0 (fully discharged) to 1.0 (100% charged). Before accessing this property, ensure that battery monitoring is enabled.
    
    If battery monitoring is not enabled, battery state is UIDeviceBatteryStateUnknown and the value of this property is –1.0.
    Availability
    
        Available in iOS 3.0 and later.
    
    See Also
    
          @property batteryState
          @property batteryMonitoringEnabled
    
    Declared In
    UIDevice.h
    

    From UIDevice Class Reference

    An then you can add to your app an plist where you will put all battery capacity for every device, read device model and with the percentange of battery and full capacity you can get the actual value in mAH.