Chat using socket.io

I want to make a chat application using socket.IO. I have a list of user groups (users in groups) that come from the server during parsing. but now I'm going to chat with all of these users. So, when I send a message, all users in the group received a message.

But first I found a library. with an example, but in the example there are no clear APIs, only the APIs in https://github.com/Gottox/socket.io-java-client , which is not clear to me. From the above API, I copied examples of classes /chat/Chat.java, ChatCallback.java, ChatCallbackAdapter.java also imported socket.jar from Google not on top of the ApI, because in the above API we need to copy scr / io / socket, it is the same. if I'm wrong. "socket.jar and scr / io / socket"

Now I have four classes above three, and one is the layout class, I named it MainActivity.java And now I want this typing of the user interface messaging. as shown below.

Please help me use this API as well as on classes and implement proper posts as shown below. I have my own server URL, which I replaced later, but now help me in the form of code how to use these API classes with the layout class.

thank

enter image description here

+4
source share
1 answer

Using Socket.io is a good start, but you will have a lot of work to create a comprehensive chat application. If you want to skip the pain by creating everything from scratch, you can turn to Hyphenate SDKs (iOS, Android and Web), which in real time communicates with the proprietary protocol via a socket.

Hyphenate Mobile, Web SDK . , .

https://docs.hyphenate.io

https://github.com/HyphenateInc

+1

Source: https://habr.com/ru/post/1545651/


All Articles