Android Example Dual Screen using MQTT

An example of sending data from device A and display on device B screen using MQTT protocol.
This is one of the solutions to this thread.
The code is kept since Aug 2023 but I don't see any one bother to ask how to implement it.
Today I share it but I hope people have really tried on their own, not waiting to get spoon feed.

Update:
Version 2 add B4J projects and tested with jMQTT v1.26 and jMqttBroker2ext v2.02 by @teddybear

There is another example using UDP which I am going to share next.
 

Attachments

  • MqttPrimaryScreen.zip
    11.3 KB · Views: 109
  • MqttSecondaryScreen.zip
    10.8 KB · Views: 99
  • MqttPrimaryScreenV2.zip
    18 KB · Views: 78
  • MqttSecondaryScreenV2.zip
    17.2 KB · Views: 79
Last edited:

aeric

Expert
Licensed User
Longtime User
Note:
I am using jMQTT v1.01 and jMQTT Broker v1.04
I haven't tested with newer version of jMQTT or jMQTT Broker.
 

Attachments

  • jMQTT.jar
    179.4 KB · Views: 57
  • jMQTT.xml
    8 KB · Views: 62
  • jMqttBroker.jar
    35.4 KB · Views: 55
  • jMqttBroker.xml
    4.5 KB · Views: 55
Last edited:

amorosik

Expert
Licensed User
Hi Aeric, your project is very interesting
Have you tried to make some comparisons regarding the performances between the project via Udp and the project via Mqtt?
 

aeric

Expert
Licensed User
Longtime User
Hi Aeric, your project is very interesting
Have you tried to make some comparisons regarding the performances between the project via Udp and the project via Mqtt?
No, I didn't explore further into this topic.
There are pros and cons or different use cases between the 2 solutions.
1 different I can see from my demo YouTube video is the MQTT solution shows the client connected and disconnected.
I am not sure how this is implemented in UDP.
In fact I am new to both solutions and I just created the examples based on my learning in a few hours, so bear with me.
 

aeric

Expert
Licensed User
Longtime User
Nice! I’ve been working with MQTT recently so this comes at the right time. Looking forward to the UDP example too. Thanks for sharing!
Thanks!
Yes I think this is a good example to showcase the use of mqtt.
I actually updated the first post to UDP example.
The example just show a message box instead but the concept is same.
You can direct access the post here:
 

Theera

Expert
Licensed User
Longtime User
Thanks!
Yes I think this is a good example to showcase the use of mqtt.
I actually updated the first post to UDP example.
The example just show a message box instead but the concept is same.
You can direct access the post here:
Thank you, Aeric for sharing them.Let me write the contents in Thai forum followingmy understanding. Thank you in advance.
 
Top