I would like to write a simple chat for android to practice. In my understanding, the principle of the chat is: There is a database where users are registered. One user chooses the second (who wants to send a message) and writes a message. It is sent to the server, the server is checked by the second user online or not. If it is online, then sends a message to it, otherwise it stores on the server until the user enters.

Please tell me where to start, what to write on the server part, the chat algorithm is about the right?

  • you would start practicing with Hello World of some kind, since you have no idea about the server part or the client part :) - pavlofff
  • Well, the usual programs for android can not write the same, just especially client-server is not engaged. So I decided to try something like chat. I know how the server and the client work. But using the example of a chat, I asked in more detail what the algorithm would be. - Collective Farmer

1 answer 1

You can write the server part on the Play framework. It is very simple and will have to write in Java. Also for the chat you need to get acquainted with the sockets. To work on android is Okhttp3. Sockets support is built in there. You will only need to make small adjustments. Server side can use this lib here: Java-WebSocket

  • Thank. I will understand - the collective farmer
  • @ Collective farmer join the advice of pavel163. I myself use this lib both on the server and on the clients. there and the application option wss workable. the truth is there is a flaw in the transfer of large binary files (I corrected myself :)), otherwise the stable is stable. - Vadim