Skip to content

Commit

Permalink
some fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyinghan committed Apr 14, 2021
1 parent 304338c commit ecdeab0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ allprojects {

```groovy
dependencies {
implementation 'com.github.shiyinghan:MqttAndroid:1.0.0'
implementation 'com.github.shiyinghan:MqttAndroid:1.0.2'
}
```

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shiyinghan.mqttdemo.base;
package com.shiyinghan.mqtt.demo.base;

import android.content.Context;
import android.os.Bundle;
Expand All @@ -16,9 +16,9 @@
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.shiyinghan.mqttdemo.R;
import com.shiyinghan.mqttdemo.event.DummyEvent;
import com.shiyinghan.mqttdemo.reactivex.RxUtils;
import com.shiyinghan.mqtt.demo.R;
import com.shiyinghan.mqtt.demo.event.DummyEvent;
import com.shiyinghan.mqtt.demo.reactivex.RxUtils;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
Expand Down
1 change: 1 addition & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,25 @@ public void onFailure(IMqttToken asyncActionToken, Throwable exception) {
}
});

mqttClient.subscribe(subscriptionTopic1, qos, new IMqttMessageListener() {
@Override
public void messageArrived(String topic, MqttMessage message) throws Exception {
// message Arrived!
addToHistory("MessageArrived Topic: " + topic + " Payload: " + new String(message.getPayload()));
}
});
// mqttClient.subscribe(subscriptionTopic1, qos, this,
// new IMqttActionListener() {
// @Override
// public void onSuccess(IMqttToken asyncActionToken) {
// addToHistory("Subscribed!");
// }
//
// @Override
// public void onFailure(IMqttToken asyncActionToken, Throwable exception) {
// addToHistory("Failed to subscribe");
// }
// },
// new IMqttMessageListener() {
// @Override
// public void messageArrived(String topic, MqttMessage message) throws Exception {
// // message Arrived!
// addToHistory("MessageArrived Topic: " + topic + " Payload: " + new String(message.getPayload()));
// }
// });
} catch (MqttException e) {
e.printStackTrace();
}
Expand Down

0 comments on commit ecdeab0

Please sign in to comment.