Raspberry Pi 3 is the latest board developed by Raspberry. It is an upgrade of Raspberry Pi 2 Model B and like its predecessor it has some great features:
- Quad-core ARMv8 Cpu at 1.2Ghz
- Wireless Lan 802.11n
- Bluetooth 4.0
The following image shows a Raspberry Pi 3 Model B:
In this section, you will learn how to install Android Things on Raspberry Pi 3 using a Windows PC or a macOS.
Before starting the installation process you must have:
- Raspberry Pi 3 Model B
- At least an 8Gb SD card
- A USB cable to connect Raspberry to your PC
- An HDMI cable to connect Raspberry to a tv/monitor (optional)
If you do not have an HDMI cable you can use a screen mirroring tool. This is useful to know the result of the installation process and when we will develop the Android Things UIs. The installation steps are different if you are using Windows, OS X, or Linux.
At the beginning we will cover how to install Android Things on Raspberry Pi 3 using a Windows PC:
- Download the Android Things image from this link: https://developer.android.com/things/preview/download.html. Select the right image; in this case, you have to choose the Raspberry Pi image.
- Accept the license and wait until the download is completed.
- Once the download is complete, extract the ZIP file.
- To install the image on the SD card, there is a great application called Win32 Disk Imager that works perfectly. It is free and you can download it from SourceForge at: https://sourceforge.net/projects/win32diskimager/. At the time of writing, the application version is 0.9.5.
- After you have downloaded it, you have to run the installation executable as Administrator. Now you are ready to burn the image into the SD card.
- Insert the SD card into your PC.
- Select the image you have unzipped in step 3 and be sure to select the right disk name (your SD). At the end, click on Write.
You are done! The image is installed on the SD card and we can now start Raspberry Pi.
If you have a Mac OS X, the steps to install Android Things are slightly different. There are several options to flash this OS to the SD card; you will learn the fastest and easiest one.
These are the steps to follow:
- Format your SD card using FAT32. Insert your SD card into your Mac and run
Disk Utility. You should see something like this:
sudo dd bs=1m if=path_of_your_image.img of=/dev/rdiskn
path_to_your_image is the path to the file with the
img extension you downloaded at step 2. In order to find out the
rdiskn you have to select
Preferences and then
System Report. The result is shown in the following screenshot:
BSD name is the disk name we are looking for. In this case, we have to write the following:
sudo dd bs=1m if=path_of_your_image.img of=/dev/disk1
That's all. You have to wait until the image is copied into the SD card. Do not forget that the copying process could take a while. So be patient!
Once we have flashed the Android Things image into the SD card, we can remove it from the PC or Mac and insert it into the board:
- Connect Raspberry Pi to a video using the HDMI.
- Connect Raspberry Pi to your network using the LAN connection.
- Connect Raspberry Pi to your Mac/PC using a USB cable.
Wait until Android Things completes the boot phase. At the end, you should see the following:
Now your development board is ready and we can start developing our first Android Things project. To confirm that your Android Things is up and running, you can execute from the command line the following command:
You should see, in the list, at least one Android device with an IP address. Congratulations; you have just installed and tested your Android Things OS. By now you should see the Android Things default screen because we did not install an app on the system.