eco_bach eco_bach - 1 month ago 25
Android Question

Google Cloud Messaging - CCS (XMPP) vs HTTP server

I've read the documentation
https://developer.android.com/google/gcm/index.html

and the only difference I can see is that a CCS (XMPP) based server allows bi-directional communication directly between an android device and the GCM server.

Are there any other reasons why you would choose CCS (XMPP) over HTTP or vice versa?

Answer

CCS (XMPP) is asynchronous, which means it should be faster than HTTP. It also uses the existing GCM connection on the device to send messages from your app to your server (which saves battery, since you don't have to open your own connection to your server).

On the other hand, HTTP is much simpler to code, so unless you need the bi-directional functionality or you need to send messages in a very high speed, I'd stick with HTTP.