I am building a mobile application that has some realtime constraints. Therefore I turn to stackoverflow to get advices & opinions and attempt to decide which is the best solution to update the state of the application while running:
- rely on long-polling or direct connection to my server
- rely on Apple Push Notification Service and Android C2DM
Beyond the fact that APNS and C2DM provide a unified interface to push notification while the application is running or not, one can say that a custom solution (based on long-polling or a direct connection) is more flexible and less dependent on the latency of Apple & Android queues.
As far as I can see, I think most of the debate stems from the cost comparison of how much battery it consumes to keep a connection opened compared to opening a connection on a smartphone.
I am therefore particularly interested in two things:
- Experiences with APNS and C2DM
- Details on all the implications of keeping a TCP connection open on a smartphone.
References welcome! Thanks!