Hacker News new | past | comments | ask | show | jobs | submit login

Receiving messages (aka "listening" in server jargon) is essentially a background task, constantly probing to check for any changes.



I think the point being made is that’s a terrible use of resources, not only are you keeping the app running, but you are also forcing the power hungry LTE radio to stay on more.

This idea that the end device should do all the work is not a sustainable approach. There should be a server side component that is handling this for you and sending push notifications when your app needs to wake up for new data.


> sending push notifications when your app needs

How do you think push notifications work? There isn't some magic in LTE to wake up your phone. Your phone needs to keep a connection open in the background and periodically wake up the modem to check for new information.

I use Conversations (XMPP client) on Android, it keeps a plain old TCP connection open in the background and honestly it does not much battery at all. It's consistently at the bottom of battery usage according to my phone.


Do push notifications take advantage of knowledge of the physical layer of the network?

It's a lot cheaper to keep an LTE radio on in a low-wattage "ping me if you need me" mode and trust the 'infinite-power' landside terminal to notify you of messages than to wake it up once every N seconds to loudly ping a cell tower "HEY LET ME KNOW IF I HAVE ANY MESSAGES KTHX."


> How do you think push notifications work?

There’s a very distinct difference between having a persistent connection that only transmits data when there’s something notable vs having a connection that constants pushes a kitchen sink of data that may or may not be needed. Sure, if you sent a push notification on every single message and status change on the IRC server, it’d likely use the same amount of (or maybe more) battery, but who does that?


Right. That's why there's an API for it. Each app doesn't have to stay awake listening. The OS will wake the app up.


Oh, that does make sense.

In that case, having the app run the background really does seem like a waste when compared to leaving the OS to do this task.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: