Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server for android chat

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:

  1. Polling / long polling.
  2. 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)
  3. Sockets. Can i use them with Tomcat or Glassfish? Are there any troubles on Android?
like image 373
madhead - StandWithUkraine Avatar asked Mar 21 '26 07:03

madhead - StandWithUkraine


1 Answers

Why not use a combination of C2DM and then that opens the app which does a poll for the data. C2DM is not designed for huge payloads but can tell the app to poll and so will be realtime.

WP7 and iOS have a C2DM equivalent with the same sort of payload restrictions but they could then share the same backend API for the poll?

like image 58
Lee Armstrong Avatar answered Mar 22 '26 20:03

Lee Armstrong



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!