android - making constant internet connection to server without draining battery -


apps twitter drain phone's battery have wake phone when new tweet comes. app need constant connection server. won't download or upload data constantly.sending tcp keep-alive every 2 minutes can save battery life or way can talk server push notifications? why push doesn't drain battery?

if want implement use google cloud messaging:

http://developer.android.com/google/gcm/gcm.html

basically create google api project sends information google cloud messaging server. server queues messages , send them final device when it's able receive them. device keeps open socket @ times receive these messages there's not big impact on battery drain.


Comments

Popular posts from this blog

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -