Reputation: 1299
I have to create a chat messenger in android studio.There are a number of alternative available to create it but I am confused what to use?GCM(Google Cloud Messaging ) or Sockets .Please help me to find the best and efficient way to create instant chat Application in android studio.
Upvotes: 2
Views: 792
Reputation: 2882
Both GCM and Sockets have there pros and cons....
1.GCM is backed by google so you can expect a layer of seqcurity for you messages.
2.GCM doesn't guarentee that your message will be delivered.
3.GCM doesn't guarentee of the time it will deliver.
4.You need google play for GCM hence you need an alternative for Ios or other non android OS.
On the other hand.
1.Sockets can work on any OS as the communication is through channels created by sockets ..Hence no dependency of any third party app.
2.You can inclue TCP or FTP(if need to send files) or othe protocols.
3.More faster than GCM
4.Complex to implement both in client and server side
SO if I prefer a socket mechanism for a chat app
Upvotes: 2