C2DM Push chat application

Currenlty I am trying to develop a simple chat application for Android. I want to create something that works like WhatsApp. Because it should be realtime, I think C2DM is the best way to send a notification when a user sends a message to another user.

Because I have read that C2DM is build for noticiations only, and not for messages I have to find a way to deliver those messages to that other contact.

Now, I have a application server, that can send C2DM notifications. But what's the best and the most energy saving way to send and receive the 'textmessages'?

I have read about polling, but it's not that energy saving I think. I have read something about 'XMPP', but how can I combine that with C2DM?

Answers


  1. User A sends message to User B, that is, it sends a message to your application server.
  2. You app server receives a message from A to B. It sends a C2DM notification to B telling that there is new data.
  3. User B receives the C2DM notification of new data, connects to your app server and retrieves the message from User A.

This mechanism only pushes data, there is no polling.


Need Your Help

AVAudioPlayer returns wrong duration for audio file

ios iphone audio duration amr

I'm trying to play an audio file in my app, and I want to show progress of playing file.

mongoDB Map/Reduce

mongodb nosql mapreduce mongodb-query

I am trying to figure out this map/reduce system in mongoDB. I have the following basic schema/layout in my collection.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.