You can use mqtt tech with wifi for messaging between mqtt clients... you need to run your broker into the network... u can find plenty examplesHello, I am new MQTT technology and therefore I want to know will MQTT allow me to use Wifi for messaging? This option can to collect information from android devices near the server (broker) by WiFi? Security tools in modern versions of android will allow me to solve my problem? Where can I find an example that is tested on fresh sdk?
Hmmm... if you run a broker locally - be sure you have exceptions at firewall-port-and app...Example MQTT chart room not worked.
https://www.b4x.com/android/forum/threads/b4x-mqtt-chat-room.61568/
Checked the example on different versions of SDK does not work. Doesn't even start
From MQTT Client there isn't any special setup to do... the only thing you must be careful is mqtt-broker/server... all other will work very easy!....I have an assumption that similar examples related to MQTT need to be installed on a smartphone via a USB cable, then perhaps the installation of the application will be successful. But I haven't read that advice anywhere. Maybe the B4X bridge application is conflicting with MQTT?
When installing via USB cable, the following error occursHmmm... if you run a broker locally - be sure you have exceptions at firewall-port-and app...
then if you are sure about firewall settings at server-broker... say here... what error you did you get at logs... to help you...
if you are not sure for broker-firewall - use hivemq server-broker
B4A Version: 11.80
Parsing code. (0.00s)
Java Version: 11
Building folders structure. (0.01s)
Compiling code. (0.01s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Compiling resources (0.04s)
Linking resources (0.24s)
Compiling generated Java code. (1.15s)
Finding libraries that need to be dexed. (0.00s)
Dex code (1.10s)
Dex merge (1.54s)
Copying libraries resources (0.44s)
ZipAlign file. (0.03s)
Signing package file (debug key). (0.48s)
Installing file to device. Error
Performing Push Install
SimpleChat.apk: 1 file pushed, 0 skipped. 883.7 MB/s (1310833 bytes in 0.001s)
pkg: /data/local/tmp/SimpleChat.apk
Failure [INSTALL_FAILED_VERSION_DOWNGRADE]
#ApplicationLabel: B4A Example
#VersionCode: 1
Did you checked your smartphone, tablet... for any B4A Example APPS (installed previous)... at your phone ...Go to Settings, Applications -> remove B4A Example ...if exists, reboot phone and try to run the examples again...Example MQTT chart room not worked. Checked the example on different versions of SDK does not work. Doesn't even start
I was given really good advice in the tools in the project settings to change the name of the package. Apparently when using the standard name EXAMPLE. Gradually, some kind of garbage accumulates inside the device, which prevents a new example from starting with the old name. Now all ok. The example "MQTT chat room" works on different versions of SDK and on modern smartphones too. But first I had to disable the virus scan when installing the application.Did you checked your smartphone, tablet... for any B4A Example APPS (installed previous)... at your phone ...Go to Settings, Applications -> remove B4A Example ...if exists, reboot phone and try to run the examples again...
Sorry I insist... may be I am wrong. But sometimes other simple things... creating problem from anywhere...
If I am wrong, tell me
ps - otherwise: describe the problem - or log you are taking...
MQTT is based on TCP/IP, it is like HTTP, it works as loog as there is a TCP/IP network, it is irrelevant to link layer.6. On another smartphone, I am trying to install another application. But after launching and entering a name, application does not feel the previously launched server, and prompts me to create the server again, but does not allow me to run the application in client mode.
The questions you are asking are general and they re not have to do with mqtt but with way working b4a and debug...I'm sorry, but the joy was premature, now the MKTT network is not working again. I have little knowledge and I'm not sure if I have the right conditions to test the collaboration of this application on several smartphones.
1. The question is whether it is possible to debug using a Wifi router or in this case only a USB cable? My main task is to make sure everything works using WIFI direct.
2. On the smartphone, I turned on the GPS and probably somehow it is necessary to set permissions so that the mmm example works?
3. How often should the package name and program version number (Name) be changed so that a new folder with the application is formed in the device?
4. When debugging, you first need to successfully start the server on the first device, after that you can try to do debugging on the second one, which should connect as a client?
5. The example now starts the server. I'm installing the example in Release mode. Then I disconnect from the B4X bridge. Externally, the application works, prints messages, but does not see customers around and it is normal.
6. On another smartphone, I am trying to install another application. But after launching and entering a name, application does not feel the previously launched server, and prompts me to create the server again, but does not allow me to run the application in client mode.
The example contains a broker library written for B4A. After successfully installing the application on several devices, I place them side by side. The first device where the application is launched should logically be the server(broker). All others connect to it as clients. I got this result when 4 devices were lying on the table side by side. But later I could not repeat this result and did not catch the pattern under what conditions a good result can be achieved. It is not possible to use an external server on the Internet or on a PC for my task. All my devices work in the absence of a PC and Internet access.The questions you are asking are general and they re not have to do with mqtt but with way working b4a and debug...
You can search the forum for all these and you will find the right answers... sure
1. Bridge logger
2. For chat example.. I don't think need it
3.it is good uninstalling examples after using them.. general speaking
4. As I know the broker is written for b4j.. so will be better trying at windows this part of server.. but will be easier using a ready broker free from internet.. as a starter
5. . .. better use a ready broker server
6. ... hmm I think you must read general for mqtt.. try Google it mqtt protocol and differences
OK using b4a broker lib... not know how well is working - but i am sure will have the same results...The example contains a broker library written for B4A. After successfully installing the application on several devices, I place them side by side. The first device where the application is launched should logically be the server(broker). All others connect to it as clients. I got this result when 4 devices were lying on the table side by side. But later I could not repeat this result and did not catch the pattern under what conditions a good result can be achieved. It is not possible to use an external server on the Internet or on a PC for my task. All my devices work in the absence of a PC and Internet access.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?