0
votes

Do XMPP Servers such as Openfire require implementation of their own in order to handle messages. Do I need a web language such as PHP in order to handle messages with Openfire? Because according to posts such as this How to make Chat Application in Android Using XMPP and GCM, I do not need to write PHP scripts in order to handle messages, Openfire (it being a XMPP server) will do all the heavy lifting. So when creating a messaging program is the only thing I need to worry about the client side code?

I've also run into contradictory information that I hope someone can clarify on. It was to my knowledge that one needed to use a XMPP server along side GCM; as GCM is not reliable in delivering messages by itself and requires an XMPP server to fully be reliable. Is this true, the above link suggests that it isn't, but according to this it is https://www.youtube.com/watch?v=5wXGcu9H91s

Some clarification would be great, thanks.

1

1 Answers

0
votes

GCM allows you to use both HTTP and XMPP to send messages down from your application server through GCM to your devices.

Only with XMPP though can you send messages from your device through GCM to your server. This allows your device to send acknowledgment messages back up to your server. This does not necessarily make GCM more reliable but it does allow you to have a better audit of what messages were actually received by devices.

Openfire is a server that supports XMPP so you will still have to implement the protocol maybe using Smack.

Note that you could skip GCM and have a connection directly between your app and your XMPP server, however this is not recommended since your app would have to be constantly connected to your server which would be very hard on the battery of the device. This is where GCM comes in, allowing your app to receive messages even when it is in the background but still being kind to the battery of the device.