Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forums Add buttons on app MQTT PAHO
https://www.eclipse.org/forums/index.php/mv/msg/1070325/1708370/#msg_1708370
I am having difficulty grade to include buttons in the application MQTT app . By the way a great example for using MQTT service. But in my application I wish there was a toogle button to upload the topic and message.
I tried to include the button on activity_publish and add a View.OnClickListener the Listener class, but without success. I think I can not include button treatment in Listener class.
Anyone have any suggestions ?
I just wanted to have a button to send topic " Led " Message " ON" , for example.
Thanks!
Regards,
Jeff]]>Jeff August2015-09-16T03:36:09-00:00Re: Add buttons on app MQTT PAHO
https://www.eclipse.org/forums/index.php/mv/msg/1070325/1708408/#msg_1708408
It sounds like the easiest way would be to add your button to the menu. In Listener.java, onMenuItemClick shows how publish() is called. You could implement your publishLedOn method and include it in the switch statement. Then just add an item in activity_publish.xml in res/menu.
Good luck!
James]]>James Sutton2015-09-16T10:47:39-00:00Re: Add buttons on app MQTT PAHO
https://www.eclipse.org/forums/index.php/mv/msg/1070325/1708492/#msg_1708492
I'm trying to work here. So far without success. But as soon as there is any news , I will publish here.
Again , thanks for the suggestion!
Jeff]]>Jeff August2015-09-17T07:05:50-00:00Re: Add buttons on app MQTT PAHO
https://www.eclipse.org/forums/index.php/mv/msg/1070325/1708759/#msg_1708759
I've been messing with the home app and saw that a simple solution could be I use the same menu / publish button with a possible toogle function. So that within the publish () method could be an IF to test the current condition of the topic. If it is ON, it publishes OFF, if OFF, ON sends the broker.
The current topic of the status information is in MqttCallBackHandle / Class in notifyArgs variable [1 ] .