I'm trying to figure it out. I have this line of code:
MqttClient Client = new MqttClient(Broker, ClientId, Persistence);
But shows an "Unhandled exception" error. So I fixed it by enclosing it with a try/catch.
try {
MqttClient Client = new MqttClient(Broker, ClientId, Persistence);
} catch (MqttException e) {
e.printStackTrace();
}
It actually works but can't understand why the need of this. Thanks in advance.