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

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -