

All the MQTT apps downloadable for android will of course be using such a library and perhaps Java is the most convenient language to use as it so well known and (pretty well) standard.įrom paho.Android Studio is an official IDE for mobile app development. In any case to use MQTT on Android you have to use a MQTT client library. I am not an Android developer, but my understanding is that Android apps are usually written in Kotlin, Java or C++ - not usually python though this may be possible. However I know for certain that I was able to establish connection from android to Raspberry Pi via MQTT I am not sure how exactly these apps on android are intended to be used - the 'MQTT Dash' android client seems to need programs running in javascript to process received data but it also supplies capability to publish data in some forms.There must be a MQTT library in android see for example


The program runs in a loop waiting for messages to be received. I used the following program (found on another website which I can't find again) on the pi to subscribe to the MQTT service and receive a message from 'MQTT Dash' on topic 'android'. Named nf and containing the two lines allow_anonymous trueĪfter rebooting I was able to connect to the MQTT broker on the pi via my local network using various android MQTT apps such as 'MQTT Dash' and 'IOT MQTT Panel' and 'publish' some test information. The Mosquitto broker is automatically started after reboot but doesn't allow connections from local network by default so I created a file in Sudo apt install mosquitto python3-paho-mqtt I installed the MQTT Broker mosquitto and the MQTT client library python3-paho-mqtt. I managed to connect from my android phone to my Raspberry Pi using MQTT. MQTT has standard linux apps on the Pi and should work fine if you can find a suitable android app do deliver a message to it. Hopefully there is one which works in the other direction. There are lots of different MQTT apps on android and I had to experiment to find one that worked for me. I have used it successfully to transfer alerts from a Raspberry Pi to an android device. I suggest you consider MQTT () which is a lightweight publish subscribe message transfer protocol. Updated 10/03/22 - see added comments at end of main body of text
