I've faced a problem of writing a backend on Java for the chat with Android clients. What are the best practices for it? After quick googling i've found some approaches:
- Polling / long polling.
- c2dm. Seems like an easy variant, but i'm afraid of message size limitation (1024 bytes). Also, users must have Google account to use this technology. It might be a problem for using other platforms (iOS, WP7)
- Sockets. Can i use them with Tomcat or Glassfish? Are there any troubles on Android?