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.
Asked
Active
Viewed 789 times
2
-
2Possible duplicate of [GCM vs. Socket in android](http://stackoverflow.com/questions/19129928/gcm-vs-socket-in-android) – Dhaval Patel Nov 20 '15 at 06:56
-
SO GCM is the best technique .Right? – Deepak Rattan Nov 20 '15 at 06:59
-
From my understanding GCM provide most functionality that chat messenger need, and in socket you have to manage it yourself unless you use any other chat server. – Dhaval Patel Nov 20 '15 at 07:05
1 Answers
2
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

Abx
- 2,852
- 4
- 30
- 50
-
-
[See this link](https://developers.google.com/cloud-messaging/ios/client) which setting `GCM client` for `IOS` – Pankaj Nov 20 '15 at 07:13
-
-
@Clairvoyant Thats a client app which you need to install inorder to use GCM service I believe.you can ask the user to install GCM client everytime..Well Ios is off topic here – Abx Nov 20 '15 at 07:21
-
@DeepakR most of the chat apps dont use GCM...Most of these app use there own mechanism ..A well built socket architecutre is what I would prefer for a chat app – Abx Nov 20 '15 at 07:25
-
@DeepakR refer this http://stackoverflow.com/questions/16637118/is-it-good-to-use-only-gcm-for-developing-chat-applications-for-android-ditching .James has a good answer for this – Abx Nov 20 '15 at 07:26
-