pappu_kutty
pappu_kutty

Reputation: 2488

Android Chat functionality, Choosing GCM implementation over HTTP or XMMP

we have already implemented GCM over HTTP for our chat functionality, but after reading GCM XMPP xmpp document and google states below benefits offered by xmpp

Benefits :-

The asynchronous nature of XMPP allows you to send more messages with fewer resources.

Communication is bidirectional—not only can your server send messages to the device, but the device can send messages back to your server.

The device can send messages back using the same connection used for receiving, thereby improving battery life.

we choose HTTP, since we are comfortable in developing using http rather than XMPP. but my concern is, will XMPP provides long term solution for our chat functionality?.

And i am not getting first two points, fewer resources (what exactly it is, when compared to HTTP), secondly, bi-directional messages, i see this can be achieved in HTTP either ,my flow diagram for http flow

enter image description here

i understand in http we need to create new connection when ever we need to invoke backend, so XMPP has advantage here. I would like to know is HTTP is right choice for chat functionality? for longer run..

Upvotes: 0

Views: 162

Answers (1)

Arthur Thompson
Arthur Thompson

Reputation: 9225

XMPP should be used over HTTP for continuous communication.

XMPP supports upstream messaging, with HTTP your client (phone) has to make an HTTP call to your app server, you cannot send an upstream message to GCM without XMPP.

XMPP makes fewer connections so overhead (battery, data etc) is much less than with HTTP.

Upvotes: 1

Related Questions