[Nexus 4 General] PhilipL:
Hi

Push notifications isn't the same as a constant connection and is often very power efficient, certainly when using Google Cloud Messaging which is on by default in Android phones.

In order to have push notifications the phone creates an open TCP connection to the server, then the phone deep sleeps normally. The Wi-Fi or Cell modem is responsible for holding the TCP connection open and raising an interrupt to wake the phone if the connection receives any packets. So during this wait, the phone is using no extra power and is in deep sleep. An open TCP connection usually times out after 10 to 15 minutes when it is no longer valid and can't be sent any data so the phone will wake, establish a fresh TCP connection then sleep again.

To send us an email, the open TCP connection is sent a few packets of data, this raises an interrupt, the phone is woken, checks the data it was sent which in this case says "New email arrived" then the phone does a normal PULL of email from the server. After the email is received a new TCP connection is left open and the phone sleeps again.

The issue with this kind of push notification is the TCP time-out value, which is network specific. It takes resources for a network to keep track of these long open connections so some networks will have a lower time-out value, which might be as little as 30 seconds or a minute so your phone is constantly chattering to the network in order to keep an open TCP connection, this will hit battery power compared to polling with a reasonable time delay. Typically mobile phone networks have lower time-outs by default as they typically see more dead connections and need to release resources used holding on to them.

However with an Android phone and any data connection, it always has a push notification connection set up with Google servers, which is why if logged in to our Google account on the phone we can visit the play store on a computer and remotely install applications. This same push messaging service is used for all Google applications including Gmail and so is using no extra battery if we choose to use it. This messaging service can be used by third parties as well, giving us push on other applications also with no extra battery hit.

The best thing if we want push but without any extra battery drain is use Gmail (which is why there is no polling option with the default Gmail application). Also most/all mobile networks will configure their networks with the maximum keep live time for open TCP connections to the Google messaging service as they know these connections will not be dead connections but in use for push and it saves unnecessary chatter on their networks.

Corporate or other Exchange accounts use the same TCP open connection mechanism for push notifications but will be setting up an extra open connection back to which ever server is hosting the service, but of course these will not be known to the mobile phone company and time-outs will not be optimised, in addition corporate firewalls and routers often are not optimised for these open TCP connections either. This means we can see a considerable hit in battery power when using Exchange accounts for push as the phone is waking every minute or so to maintain an open TCP connection which is being closed on a very quick time-out, in which case switching to polling would be better. It has been this issue with poorly configured networks within some companies giving push a bad name in the battery department.

Note that polling uses more power than renewing the open connection on a time for time basis. So polling every 15 minutes will use a lot more power than renewing the TCP connection every 15 minutes. This is because polling requires the phone to exchange more data as it has to log into the remote service using our credentials and do a pull to see if new data or not.

So in summary, using Google Gmail or other Google services with push uses no extra battery in Android phones. Using other third party services with push notifications (if they don't use Google Cloud Messaging) can be very variable in battery usage.

Regards

Phil