Skip to content

Commit fe628bf

Browse files
author
tzihan
committed
Fix bug 447031 - Refine Android service sample
Add qos and retained information to history when publish message and receive message. Bug 447031 Change-Id: I6dc7aa824959d344bb6731ba53821b8eaef7783b Signed-off-by: tzihan <zhtang@cn.ibm.com>
1 parent 25eefc8 commit fe628bf

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

org.eclipse.paho.android.service/org.eclipse.paho.android.service.sample/src/org/eclipse/paho/android/service/sample/Listener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ private void publish()
240240

241241
String[] args = new String[2];
242242
args[0] = message;
243-
args[1] = topic;
243+
args[1] = topic+";qos:"+qos+";retained:"+retained;
244244

245245
try {
246246
Connections.getInstance(context).getConnection(clientHandle).getClient()

org.eclipse.paho.android.service/org.eclipse.paho.android.service.sample/src/org/eclipse/paho/android/service/sample/MqttCallbackHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception {
8282
//create arguments to format message arrived notifcation string
8383
String[] args = new String[2];
8484
args[0] = new String(message.getPayload());
85-
args[1] = topic;
85+
args[1] = topic+";qos:"+message.getQos()+";retained:"+message.isRetained();
8686

8787
//get the string from strings.xml and format
8888
String messageString = context.getString(R.string.messageRecieved, (Object[]) args);

0 commit comments

Comments
 (0)