P
P
prizrak392017-02-17 16:54:14
Java
prizrak39, 2017-02-17 16:54:14

How to choose the right implementation for Android chat?

Good afternoon.
There was a need within the application to organize the functionality of sending private messages between users. The question is what is the best way to do this?
1. The first option that immediately came to mind with the help of REST. With a certain frequency, we send a request to the server (for example, every 5-10 seconds) to track new messages. It will work, for example, if there are, let's say, 1000 users in total, and if more (then crash)? It also turns out that even in the background the application will always work, which is probably not correct.
2. The second option is implementation on sockets. I don't know if this is correct or logical.
3. The third option is to use XMPP. If I understand correctly, then existing implementations can be used as a server. Write the client yourself. Or take something ready like THIS . While I can not appreciate the pros and cons of this solution.
Perhaps there are other implementation options, please suggest.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Zagaevsky, 2017-02-17
@prizrak39

Writing a chat by yourself is long and expensive. Your first two options are not viable.
XMPP is a good option, but writing the client yourself is again expensive and time consuming. We used to embed xabber . He performed his functions.

M
Multigame, 2017-02-17
@Multigame

1) Well, more precisely, the problem will not be directly in the number of users, but in the number of messages. Or rather, it will be somewhat out of date, because new messages will be loaded only in a batch and only once every "5-10 seconds"
If a general chat is not planned, but only private messages, then in principle this is an acceptable option. Although yes, given the processing of all http headers (more precisely, each request / sending will be a separate request), the load will be greater than on the same sockets.
2 & 3) The question is how much you plan to customize with some features that do not fit into the given platform or protocol. The disadvantages of xmpp are, in principle, described quite well even on Wikipedia.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question