views:

380

answers:

2

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

A: 

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

Vladimir
makes sense...otherwise they wouldn't bother to put the plug icon inside the battery picture .... intuitively speaking
Iuliu Atudosiei
A: 

I think the device is always drawing off the battery in order to guarantee a smooth power curve i.e. 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.

TechZen
From what I noticed the behaviour is like this:1. battery is 85 % let's say2. plug it in the USB3. battery will have the lightning icon inside battery picture4. battery reach 100 % and then the power plug icon is displayed5. after some usage....battery drops to 96% suddenly and starts charging againThese means that it is consuming battery i guess...what do you think ?
Iuliu Atudosiei