Hacker News new | ask | show | jobs
by orangecat 5918 days ago
I'd bet that app was poorly written and doing something else in the background. An app that is just listening for data from an open connection should be using roughly zero CPU. But we'll try science; I've signed into AIM on my Nexus One and left it running in the background. The battery is at 81% now, I'll report back in an hour.
3 comments

I'd bet that app was poorly written and doing something else in the background. An app that is just listening for data from an open connection should be using roughly zero CPU.

It would be too much work to vet every app for good concurrent programming. It's a much better idea to disallow it and add an API with resource controls later. This is the only way to protect users from resource hog apps.

If you keep a connection open it drains battery life because the chip can't power down.
Sort of. In tumult's case he's got a connection that's actively downloading data and playing music. I would assume that'd keep the radio chipset (either wifi or cell, whichever he's using) and the CPU both from being able to switch to a lower power standby mode.

However, you can have an open but idle connection open in the background with only minimal battery drain. That's how pretty much every kind of push notification or IM system works, even on cell phones.

77% after an hour.
Sign in with the connection currently using WiFi instead of GPRS/3G, and it will keep the WiFi hardware on, which is what kills it. There is no way for a normal user to know that they need to open new, persistent connections over a connection type that uses the cellular modem instead of the WiFi. And Android defaults to using WiFi for new connections if the WiFi hardware is powered on and connected to a network.

The best way to save battery on an Android phone is to turn off WiFi unless you need it at some point during the day. iPhone will stop attempting to do push notifications and the background Apple apps will disconnect if the only available connection is WiFi.

I'd also like to point out that "I bet the app was poorly written" is exactly the situation Apple is currently avoiding until they are confident they have a reasonable technical solution to it.

I was signed in using WiFi, and I normally have WiFi enabled all the time and get over 24 hours of battery life. Maybe some wireless chipsets suck too much power, but it doesn't appear to be a problem on the N1.
Maybe we're doing something different, but I cannot get my Nexus One to stay alive for longer than 5 hours with an active net connection. It if it's a low-traffic connection (calm IRC channels, occasional email polling) it will last a day (same with my G1) but streaming radio, etc will leave it dead in a long afternoon.
Ah.. Streaming radio. By active net connection I thought you meant email polling, IM, etc.

Playing streaming video will kill the battery pretty decently, but IMHO that seems fair. Your keeping the radio pretty busy, the audio hardware, the cpu, etc.

I'd actually like to hear from an iPhone user whether they can run Pandora or Last.fm for 5 hours straight without killing their battery either.

I'm an iPhone user as well, and it also kills the iPhone. the point was that on iPhone, 3rd party apps are not given the opportunity to do this without the user being aware (because it's in the foreground.) i've had a runaway android app kill my phone after it screwed up and started devouring resources in the background while it was in my pocket.
Wow, thanks for this point. Just reminded me to turn off the android phone I was using but had stuck in the drawer.