On Fri, Aug 19, 2011 at 9:35 PM, MK Z <v5s12.msc...@gmail.com> wrote:
> Hi,
> Im very new to this GAE services. So far I managed to run my apps on
> GAE. Im trying to add multi-user chat on my app. Ive been trying to
> search how to implement this-both using XMPP and Channel API. Im
> interested on the latter. The problem is I couldnt find any tutorial
> or example to begin with.. the channel API look simpler but whe I
> visited other people blog/tutorial it doesnt really show how to do
> it.. can someone help me please. Thanks

First of all you should take a look at the documentation
(http://code.google.com/appengine/docs/java/channel/) and the
tic-tac-toe application
(http://code.google.com/p/java-channel-tic-tac-toe/). It provides a
very good base to implement the Channel API for a single user.

To add a multi-user chat you could reuse the same basics. When a user
sends a message, make it send a request to the server. The server then
gets the list of all the connected users IDs (stored in memcache for
instance) and broadcast the message to each of them (as shown for a
single user in the documentation).

You will then need to handle the user's presence
(http://code.google.com/appengine/docs/java/channel/overview.html#Tracking_Client_Connections_and_Disconnections)
to update the list of connected users as people join and leave.

This would allow you to create a basic multi-user chat. If you have
more specific questions, feel free to ask.
-- 
Sébastien Tromp

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to