I would use a direct socket connection using a well-known protocol such as XMPP . You can use a library (e.g. smack ) to avoid implementing the entire protocol yourself.
The main advantage of XMPP over RMI or your homemade protocol is the well-established protocol designed specifically for this purpose: IM.
, XMPP, Google Chat (GTALK) Facebook.