Implementing the MQTT subscriber using Android Things

Now it is time to implement the MQTT subscriber using Android Things. As we stated before, an MQTT subscriber is a component that registers itself to a topic and receives messages every time a publisher publishes data on that topic. In other words, we use the Android Things app to receive data coming from external remote sensor units. To this purpose, we can use one of the several available libraries that handle the MQTT protocol. Even if there are several Java libraries that could be reused in Android with some adjustments, we prefer to choose one that already supports Android. For these reasons, this IoT project uses Eclipse Paho (https://eclipse.org/paho/). This is an open source project ...

Get Android Things Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.