Integrating Android Things with Alibaba Cloud IoT

In this article, we will show you how you can connect Android Things to your Internet of Things (IoT) network easily with Alibaba Cloud IoT Platform. We will build a functional formaldehyde and temperature sensor for this project.

Hardware Devices

Project Device List

Image for post
Image for post

NXP i.MX7D Pins

NXP Pico i.MX7D full I/O interface document

Image for post
Image for post

Device Wiring Diagram

Image for post
Image for post

Alibaba Cloud IoT Configuration

After setting up the hardware, it’s time to configure the software on Alibaba Cloud IoT Platform.

First, navigate to the IoT console and activate Alibaba Cloud IoT. Create an advanced product and add product attribute definition:

Image for post
Image for post
Image for post
Image for post

Android Things Device Development

  1. Create an Android Things project using Android Studio, and grant network permissions
  1. Add the “eclipse.paho.mqtt” repository to gradle
  1. Read DHT12 data through I2C
  1. Obtain Ze08CH2O data through UART
  1. Create an Alibaba Cloud IoT connection and report the data

Real-time Data on Cloud Console

After the device is started, you can view the real-time data of the device on the Alibaba Cloud IoT console, Device Management -> Running Status.

Image for post
Image for post

Source Code

To get the source code for this project, visit the following GitHub link: https://github.com/iot-blog/aliyun-iot-android-things-nxp

Reference:https://www.alibabacloud.com/blog/integrating-android-things-with-alibaba-cloud-iot_594141?spm=a2c41.12267708.0.0

Written by

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store