简体   繁体   中英

iphone battery charging indicator

Context:

iPhone is connected to the PC via cable and power indicated 100% ( the icon of the batter contains a small power plug also)

Question:

In this stage the phone is powered directly from USB or is it using the battery ?

Thanks

(From developer point of view): there's UIDeviceBatteryState enumeration that contains the battery power state of the device. Among its possible values:

  • UIDeviceBatteryStateUnplugged : The device is not plugged into power; the battery is discharging

  • UIDeviceBatteryStateFull : The device is plugged into power and the battery is 100% charged.

So from these descriptions follows that device does not drain battery if it is plugged into power even if it is 100% charged.

I think the device is always drawing off the battery in order to guarantee a smooth power curve ie the battery works like a buffer of sorts. (It also simplifies the hardware.) However, when it is plugged in, the power system continually charges the battery so the net charge on the battery never changes.

I don't think that has any relevance to programming. Usually, you only need to know if a device is plugged in if you're doing something that might take longer than the battery can last. In that case, where the power comes from while plugged in really doesn't matter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM