I am considering using a permanent connection to a cloud service from an Android application. This will work all the time in the background (or something like that).
I am considering using network sockets or XMPP to maintain a connection, basically looking for a light connection that will not drain the battery. I want to be able to click real-time notifications on this connection, so periodic polling is undesirable. I know about C2DM and other commercial solutions, but I want to give up my own. This is why I use a web socket (or other lightweight connection). So, if I go along this route, which of the best practices should I know?
I think of things like:
This may not be the answer you are looking for, but I think you will want to rethink your architecture.
Things you can expect from a mobile platform
Basically, your application should be able to cope with the loss of communication, because it is almost guaranteed.
, , . , , . , .
. "push- " " ". .
Android, XMPP, , , IP- . , . Yaxim, Project MAXS Beem, . , XEP-0286: XMPP
, , , Google C2DM? . , , " ". , , , - (~ 0-30 ).