build.gradlefile of your project:
Applicationclass of your android app add the following code to init MQTT chat:
LoginActivityafter user login success to your application, use
logIn()function to login user to MQTT chat.
Connect()function allows you to connect the logged-in user to MQTT chat. A user should be logged and connected to MQTT chat to be able to view chat interfaces.
FrameLayoutcomponent to MainActivity layout activity_layout.xml.
oncreate()method of your main activity, affect