On software development, quality, security and broken racecars

Android Things (formerly “Brillo”) is a streamlined version of Android designed for small form-factor and IoT devices. Here is a simple example of a Things app that provides a RESTful web interface to control the state of an LED on a Raspberry Pi GPIO port.

What you will need:

A Raspberry Pi 3 Model B

A breadboard, ribbon cable, 330 ohm resistors, LEDs, jumpers

An 8GB or larger Micro SD card

Ethernet cable

HDMI cable

Android Studio with API 25 or higher tools installed

cURL

There are many Raspberry Pi 3 kits available that come with everything you need to get started. Check the Android Things Raspberry Pi hardware page for more information on getting the Things preview image loaded onto an SD card and booting up.

You will also need access to “adb” from the command line.

Setup the Hardware

Unplug your Raspberry Pi and attach the ribbon cable and breadboard. Connect a 330 ohm resistor between BCM 21(see pinout) and the long leg (anode/+) of an LED. Use a jumper to connect the short leg (cathode/-) of the LED to ground. For example:

Double-check your connections and power up the device. Connect the Android debugger with:

1

adb connect <ipaddress>

The IP address should be displayed at the bottom of the Android Things boot screen.