2017-01-25

Android Things makes it way easier to build IoT applications using the Android Framework and the tools you already know. Let’s have a look at how to flash Android Things to a Raspberry Pi 3 and build our first application.

Our tools

We’ll use the following tools throughout the tutorial:

Android Studio

A Raspberry Pi 3 with no flashed image

A micro SD memory card with at least 8GB and an adapter so you can flash it

The latest Android things preview image for Raspberry Pi. Download it here

SD Card Formatter installed

An ethernet cable connected to your router

A monitor and keyboard to hook up to your Pi

I have completed this tutorial using a Mac, so the software described will likely not work on Windows or Linux, but you should be able to find equivalents if you’re on a different OS.

Flashing the Android Things image

Extract the files from the zip file you downloaded from the Android Things website and you should end up with a file called iot_rpi3.img. This is an image file and we will flash it to our memory card. If you have the file, feel free to skip the next section and head straight to formatting the memory card..

I don’t have iot_rpi3.img!

When trying to extract the file you may hit a perpetual issue where you’ll end up with a file called androidthings_rpi3_devpreview_1.zip.cpgz. Extracting that file would then create another file called androidthings_rpi3_devpreview_1 1.zip.

Unzipping the file with 7zip via terminal however solves this issue. To install 7zip and extract the file run the following:

Formatting the memory card

Once you’ve extracted the disk image from the zip file, we need to format the memory card and and install the disk image on it. If your memory card already has something on it, and that “something” is another Raspberry Pi image, you may see the message:

The disk you inserted was not readable by this computer.

To solve that issue, open SDFormatter, select the SD Card and click Format.


After the disk is formatted we need to identify where we want to install the image. In your terminal run diskutil and make a note of the disk number assigned to the memory card.



On my machine you can see that the memory card is disk2.

Now that we know which disk number our card has been assigned, it’s time to unmount that disk so we can flash it. In terminal run:

To flash the image to disk run the following command in the same directory where the Android Things image was extracted:

This process will take anything from 5 to 15 minutes depending on the size and speed of your memory card. Get yourself some coffee, we’re nearly done.



When the process completes, you should get a message pop up saying

The disk you inserted was not readable by this computer.

Great, we’re done with this bit.

Booting up the image

Now that our image has been installed to the memory card, we’ll put it in the Raspberry Pi 3 and boot to check that everything is running as expected.

It’s a good idea to connect an HDMI cable your Pi at least for a bit while we set it up. It will save us from having to guess whether things are running as expected or not.

If you see a splash screen that resembles the one above you’re doing great!

Bringing the “I” back to IoT.

We’ve successfully imaged the memory card and used it to boot the Pi, but notice the splash screen says “No Wifi Connection” and “No Ethernet Connection”.  We need to solve that connecting our Pi to the network.

Power down the Pi momentarily by unplugging its micro-usb cable and connect an ethernet cable. Power it again and you will see that it has an assigned IP address. <img src="https://s.w.org/images/core/emoji/2/72x72/1f389.png" alt="

Show more