The Mqtt Android Service is an MQTT client library for developing applications on Android,based on Eclipse Paho Java MQTT Client.
Step 1. Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency:
dependencies {
implementation 'com.github.shiyinghan:MqttAndroid:1.0.2'
}