Catalin
Catalin

Reputation: 762

Android Chat Application Development

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.

Upvotes: 10

Views: 5471

Answers (2)

Brij
Brij

Reputation: 269

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.

Upvotes: 7

Yusuf X
Yusuf X

Reputation: 14633

asmack and OpenFire is the easiest way. No need to reinvent the wheel.

But if you did want to RTW, then open a socket while the app is in the foreground, and use C2DM when it's not. BTW C2DM is a PITN to work with, so consider using a service like Urban Airship.

Upvotes: 5

Related Questions