"# Android-Things-Mqtt-DEMO"

If you are new to Anroid Things then I would recommend you to go through the below mentioned links:

This repo contains demo application for using MQTT on android things via "Eclipse Paho MQTT Client". In order to use the the project you will require:

  • Android Studio 2.2+
  • Android SDK with API 24(Android 7.0).
  • Android SDK Tools with v25.0.3 or higher.
  • Rasberry-Pi 3 with Android-Things installed.
  • A bread-board.
  • 2 x jumper wires (female-to-male).
  • A 633nm Led(Any color).
  • A 220 ohm registor(optional).

The following diagram shows configuration:

hardware configuration

Once you are done with setting up the project in Android Studio and have configured and connected the Rasberry pi 3, you can do these things in order to test/run/install the app on Rasberry pi 3.

  • Run the app from studio.
  • or Install the app via adb.
You can also use this project for other Android Things compitable boards just change the pin name accordingly, here "BCM5"

If you want to try the MQTT broker on your server/local machine, then you can opt for Mosquitto MQTT broker:

or can use any other broker supported by "Eclipse Paho MQTT Client Library".

NOTE:

In order to use your own MQTT broker just change the
BROKER_URL = "tcp://iot.eclipse.org:1883";
to
BROKER_URL = "tcp://your.broker.url:here";

For more details on MQTT you can check the below mentioned presentation on slide share:

You can use any of the third party MQTT client apps available on play store.for example:

For more information on "Eclipse Paho MQTT Client" please visit: