duong_dajgja
duong_dajgja

Reputation: 4276

Google Cloud Message or XMPP

I have a project that requires communication between Android Clients and a Server.

The communication flow is:

For the direction from clients to the server, there is no problem. But in the reverse direction, from the server to clients, I have some issues. I'm using Google cloud messaging, but I realized there is some delay or loss of commands. I also considered XMPP technique. If I use XMPP, the server and clients will become users of XMPP server (like chat users). It's quite good except the case of losing internet connection.

Anyone, who has experience in XMPP server or/and GCM, kindly give me some recommendations.

Upvotes: 0

Views: 1935

Answers (3)

Jitender Dev
Jitender Dev

Reputation: 6925

XMPP / Jabber is used for real time communication . If you want to develop a chat app like 'whatsapp' then you should go with XMPP.

GCM is a cloud which stores your messages prior sending even if your app is not running cloud saves your messages and send them as soon as your device got connected to internet.

Your requirement is real time chat , so you must go with XMPP.

Upvotes: 3

duong_dajgja
duong_dajgja

Reputation: 4276

I have already tried to use XMPP instead of GCM. Because clients often move very fast so they use 3G or 4G to keep the internet connection. I tested with following scenario:

  • Server count from 1 and send this number to a client every 30 seconds
  • When the client receives the number, it just response to Server
  • Server receives the response and calculates "Round Trip Time" of the message

I tested with 3G and 4G connections, in each test the server counted from 1 to 600

And here is the result:

3G:

  • Loss: 10 / 600
  • Average RTT: 5.002 seconds

4G:

  • Loss: 4 / 600
  • Average RTT: 1.112 seconds

Actually, if clients use 3G connection the delay is not acceptable. Do you have any ideas to solve this problem?

Upvotes: 1

user2164757
user2164757

Reputation:

I agree with Brontok, except that:

" GCM is a cloud which stores your messages prior sending even if your app is not running cloud saves your messages and send them as soon as you run your app. "

GCM stores your messages to send them when you have network connection (Android play services is reachable) even if your app is not running You receive the message, and if through notification you can "revive" your app even if it is "dead"

Upvotes: 1

Related Questions