D DickD Active Member Licensed User Aug 1, 2017 #1 I am trying to implement UDP auto discovery in IOS. I am trying to follow the "MQTT Chat with auto discovery" sample program provided. However, this appears to be an android app and trying to convert it to ios is difficult. First I notice that even trying to execute this in B4A results in the definition of MQTTclient and MQTT broker as unknow libraries. What libraries do I need to load in order to use these? Next I saw a posting in which Erel says that to convert this to ios you only need to copy the sub GetBroadcastAddress to your ios app. This results in errors with "Dim niIterator As javaobject" as unknown type: javaobject. Lastly I do not understand the relationship between UDP and MQTT. From my reading it seems that UDP packets/sockets can send and receive data all by themselves so what does MQTT do? Is it even compatible with IOS????? I did find a discussion of MQTT under B4J!!!! I wouldn't have even thought to read anything labeled B4J when I'm writing a B4i app. It seems you need to have an awful lot of previous knowledge to use UDP auto discovery. Can anybody explain this to me?
I am trying to implement UDP auto discovery in IOS. I am trying to follow the "MQTT Chat with auto discovery" sample program provided. However, this appears to be an android app and trying to convert it to ios is difficult. First I notice that even trying to execute this in B4A results in the definition of MQTTclient and MQTT broker as unknow libraries. What libraries do I need to load in order to use these? Next I saw a posting in which Erel says that to convert this to ios you only need to copy the sub GetBroadcastAddress to your ios app. This results in errors with "Dim niIterator As javaobject" as unknown type: javaobject. Lastly I do not understand the relationship between UDP and MQTT. From my reading it seems that UDP packets/sockets can send and receive data all by themselves so what does MQTT do? Is it even compatible with IOS????? I did find a discussion of MQTT under B4J!!!! I wouldn't have even thought to read anything labeled B4J when I'm writing a B4i app. It seems you need to have an awful lot of previous knowledge to use UDP auto discovery. Can anybody explain this to me?
Erel B4X founder Staff member Licensed User Longtime User Aug 2, 2017 #2 There is no relation between MQTT and UDP discovery. It is just an example that uses UDP to discover the "mqtt server". DickD said: Next I saw a posting in which Erel says that to convert this to ios you only need to copy the sub GetBroadcastAddress to your ios app Click to expand... This is not what I said... Finding the broadcast address: B4A: https://www.b4x.com/android/forum/threads/75694/#content B4J / B4i: UDPSocket.GetBroadcastAddress Click to expand... You should use UDPSocket.GetBroadcastAddress from the Network library to find the broadcast address. Upvote 0
There is no relation between MQTT and UDP discovery. It is just an example that uses UDP to discover the "mqtt server". DickD said: Next I saw a posting in which Erel says that to convert this to ios you only need to copy the sub GetBroadcastAddress to your ios app Click to expand... This is not what I said... Finding the broadcast address: B4A: https://www.b4x.com/android/forum/threads/75694/#content B4J / B4i: UDPSocket.GetBroadcastAddress Click to expand... You should use UDPSocket.GetBroadcastAddress from the Network library to find the broadcast address.