views:

256

answers:

2

I have an application that keeps a long-standing network connection to a server.

I periodically ping the server to know if its still alive.

I imagine that it affects battery life, but other than trying to wall-clock time the time between charges, I don't have a good way of quantifying this.

Is there a mechanism for being told when the CPU 'wakes up', or when it wants to go to sleep?

Is there a standard way of doing long standing connections that minimises power consumption?

+2  A: 

I imagine that it affects battery life, but other than trying to wall-clock time the time between charges, I don't have a good way of quantifying this.

Settings > About Phone > Battery use

CommonsWare
Yes, when you are wall-clocking you are using this, or the same status shown on the lock screen.It doesn't help you understand if your app is causing it, nor how to reduce it though does it?
Will
Sure it does. If your app appears in the list, you're probably using too much battery.
CommonsWare
+1  A: 

You may find this app useful: http://powertutor.org/

sbq