I want to create a chat application for Android and I want to know the best way to do it. My first option is to use a socket connection between the phone and the server so the server can send any new messages to the phone.
The second option is to use C2DM.
A chat application like what's up how is implemented with socket or using C2DM?
Is there a better way to create such an application than the above?
Thank you.
C2DM (now known as GCM) will not be good choice for building a chat application. Create a socket connection with the server when the app is in foreground, when app is in background use GCM for push notification purpose. You will have to host your own servers but I would suggest to not to reinvent the wheel and use something like Applozic (https://www.applozic.com) chat sdk which will give you features like whatsapp and a lot more within an hour.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With