D
D
Dmitry Laptev2016-10-08 08:39:54
Android
Dmitry Laptev, 2016-10-08 08:39:54

How to implement a feature in the chat?

I'm working on a social application (no, I don't want to become the second Durov, the implementation is purely interesting) and the question arose: how to make the "User is typing a message" feature in the chat window? Do I need to put some kind of listener on the text field? Or write the state somewhere? Or some other method.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Андрей Мывреник, 2016-10-08
@gim0

You can look at the example of VK :
1. When the user starts typing something, a status change request is sent. Yes, it needs a listener.
2. The server temporarily (10 seconds) stores information that the user is typing a message.
3. If text input continues after 5 seconds or more, a second request is sent to extend the status for another 10 seconds.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question