jMqttBroker library is based on the moquette open source project:
https://github.com/andsel/moquette
It implements a MQTT broker. If you are not familiar with MQTT then start with this tutorial:
https://www.b4x.com/android/forum/threads/59471/#content
The broker is like a "black box". It is responsible for managing the clients and routing the messages.
With this library you can embed the broker inside your app instead of using an external broker.
Note that this library can also be used with B4A. You can turn any Android or Linux board to a MQTT broker.
Using this library is simple:
Code:
Sub Process_Globals
Dim broker As MqttBroker
End Sub
Sub AppStart (Args() As String)
broker.Initialize("", 51041) 'first parameter is the event name. It is currently not used.
broker.Start
StartMessageLoop 'Non-UI app
End Sub
Download link:
www.b4x.com/b4j/files/moqueutte.zip