APP_ID
and APP_SECRET
. You may need these during installation.build.gradle
file of your project:build.gradle
file of your main app:Application
class of your android app add the following code to init MQTT chat:LoginActivity
after 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.FrameLayout
component to MainActivity layout activity_layout.xml. oncreate()
method of your main activity, affect MqttchatFragment
to FrameLayout
component.MainActivity
should extend PresenceActivityA
to handle MQTT reconnections and states of presence transitions.