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 create a socket connection between phone and the server so the server can send any new messages to the phone.
And when my app is not in foreground i want to use c2dm to start the application and connect to the server to get msg.
My second option is to use xmpp, but as far as i know it uses TCP/IP (socket based) so I am wondering how xmpp pushes messages when the app is not in foreground like c2dm does.
So my questions are:
1) How does xmpp actually works, and how can xmpp push msg like c2dm when the app is not in foreground.
I know xmpp is the fastest solution but I want to understand and create my own app.
Thank you,
Catalin
My first option is to create a socket connection between phone and the server so the server can send any new messages to the phone.
And when my app is not in foreground i want to use c2dm to start the application and connect to the server to get msg.
My second option is to use xmpp, but as far as i know it uses TCP/IP (socket based) so I am wondering how xmpp pushes messages when the app is not in foreground like c2dm does.
So my questions are:
1) How does xmpp actually works, and how can xmpp push msg like c2dm when the app is not in foreground.
I know xmpp is the fastest solution but I want to understand and create my own app.
Thank you,
Catalin