4 ms·
This actually happens on Android (read about Doze mode), but the issue with your approach is that you don't get realtime delivery - only periodic sync. Which is
by izacus 8y ago
This actually happens on Android (read about Doze mode), but the issue with your approach is that you don't get realtime delivery - only periodic sync. Which is actually less efficient, because the device must wake up on interval, activate the radio and poll for changes.
FCM (and Apple push) run a single keep-alive TCP connection and incoming packets will cause radio and application process wakeup only when necessary.
This change significantly improved Android battery life (remember that HN Apple lovers really loved to bash on Android battery life before this FCM push happened). The fact of the matter is that a lot of developers didn't care one bit about battery life and abused Android background services when there was no need to do so (e.g. schedule periodic wakeups to check for a preset alarm needed once 24 hours) and if we learned anything by this experiment is that you simply can't trust developers to respect users anymore.
- nicoburns 8y agoDoes the 1 tcp connwction notnrequire the radio to wakeup to receive pushes?
- izacus 8y agoIt does, but not really periodically - the radio is just listening and not transmitting until a packet comes. Then it wakes up the application processor to handle it.
- int_19h 8y agoI guess the question is, if a single listening TCP connection is not a problem because everything can sleep until a packet arrives, what's the problem with multiple apps each opening such a connection?
- izacus 8y agoIncrease amount of chatter, more keep alives, problems with NATs (see the other post in this thread) which don't whitelist non-Google/Apple endpoints, etc. But majorly - it makes little business sense for Google to support that. It can only make Android look worse for little gain to them.
- on_and_off 8y agoDev here : you are 100% right that battery life is not optimized for in most cases. For one it is hard to measure, and many devs don't really know/care about it. FCM is a boon in this regard. So are the restrictions that Android is adding to background processing. They are technically not that necessary ... except that you can't trust any app not to abuse it, so the new model is so much better. Also, thanks Google for finally forcing apps to target the last version or so of this OS so they have to adopt all these new optimizations, whether they want to or not.