We have a networking library that is designed to be used alongside
PlayN for synchronous or asynchronous multiplayer games. For Android
it uses straight sockets, for web games it uses WebSockets. It
provides a GWT-like RPC mechanism, as well as an event-oriented API
wherein clients subscribe to "distributed" objects and receive events
when attributes of those objects change.
Unfortunately, it is not currently well documented, because it is
evolving, along with PlayN, as part of Three Rings' new MMO game
development platform (which is open source, as is all of our
infrastructure software). However, if you are working on a
serious/large project, investing the time to figure out how it works
will pay back great dividends.
The project itself:
http://github.com/threerings/nexus
And here's a (demonstration) game that uses it (also in-development,
but the basic bits are there):
http://github.com/threerings/atlantis
Currently the game uses a standalone server that embeds Jetty and uses
Jetty to serve the servlet which handles the web sockets stuff. The
non-web-sockets (i.e. Android) connections happen over a straight
socket, with a custom binary serialization protocol. If you plan to
host your own server, this is likely to be the best approach. At some
point, we plan to investigate how to get Nexus working on Google App
Engine, but there are various issues we need to sort out before that's
going to be turn-key.