How to Build Your Own Android TV Box with Raspberry Pi

What are you going to do with your new Raspberry Pi? First and foremost, don’t stress if you don’t have a second monitor. For remote access, you can set up VNC Connect on the RPi and connect to it using your Windows laptop as a monitor. It’s possible to build an Android TV Box using a Raspberry Pi, but it requires a separate screen or television. Installing Android TV on a Raspberry Pi and accessing the Google Play Store and Services are covered in detail in this guide. Let’s get started, shall we?

With a Raspberry Pi, you can build your own Android TV box (2021)

Don’t worry if you’ve never used a Raspberry Pi before; this guide was written with beginners in mind. Your custom Android TV on Raspberry Pi will be up and running in no time if you follow the instructions. For your convenience, you can use the table below to jump between sections.

Requirements

1. To get Android TV running on your Raspberry Pi, you’ll need a monitor or TV. Remotely, this cannot be done.

2. Your board’s HDMI cable should be used. The HDMI to HDMI cable for the Raspberry Pi 4 is different from the HDMI to HDMI cable for the Raspberry Pi 3.

3. To run Android TV, you’ll need at least 2GB of RAM on a Raspberry Pi 3 or 4.

4. A microSD card with at least 16GB of available storage space.

5. Mouse and keyboard. A wireless combo version is even better, as long as you can get it.

6. Your board’s power adapter is required for this.

Downloads

  • To get started, you’ll need to download the Android TV OS for Raspberry Pi first. The popular developer KonstaKANG is known for creating a variety of Android ROMs for the Raspberry Pi. Many versions of the TV operating system are based on Lineage OS and are available for use on a wide range of devices. On your board, you can download any Android TV release, but I’d advise you to stick with Android TV 10. However, for the purposes of this guide, I am using Android 11 to see how it performs. You can download RPi 4 by clicking this link. Right-click the top-right corner of your screen and select “Devices” from the drop-down menu.
Roms for Raspberry Pi 4
  • Downloading the GApps package is next because Android TV does not include Google apps and services. Simply open this link and click on the download button (tvstock is selected) if you are installing Android TV 10. Download the “tvstock” test build here if you’re trying out a new Android TV 11 build like I am.
The Gapps for Raspberry Pi software package
The Gapps for Raspberry Pi software package
  • In order to flash the Android TV OS onto the SD card, you need to download balenaEtcher (Free).
download the balenaetcher

Install Android TV on Raspberry Pi (2021)

1. Extract the Android TV build you’ve downloaded and you’ll get an IMG file.

Install Android TV on Raspberry Pi (2021)
Install Android TV on Raspberry Pi (2021)

2. BalenaEtcher can now be used to download and install the Android TV IMG file. However, you may have a different version of Android TV. The SD card should then be selected and “Flash!” should be clicked.

Install Android TV on Rpi via USB Flash Drive
Install Android TV on Rpi via USB Flash Drive

3. The SD card can now be removed and inserted into the Raspberry Pi after the flashing process has completed. Connect a keyboard and mouse as well. Connect the HDMI cable and the power supply to the monitor/TV.

Raspberry pi 4
Raspberry pi 4

4. You’ll see Lineage OS appear on the screen in a matter of seconds.

Start-up screen for LineageOS
Start-up screen for LineageOS

5. This is the Android TV home screen, and it will take some time before you get to this point. The Google Play Store and Services must now be installed on Android TV. The F2 key on the keyboard can be used to return to the previous page. Android TV on Raspberry Pi has some keyboard shortcuts, such as the ones listed below: Home, Back, Multi-tasking and Menu are all accessible by pressing the F1 key. Activate and hold the button. F5 is the Power Menu, F11 is the volume down button, and F12 is the volume up button.

With a Raspberry Pi, you can build your own Android TV box.
With a Raspberry Pi, you can build your own Android TV box.

Build an Android TV Box Using a Raspberry Pi and Google Play Services

1. Installing Google Play Store and other services on Raspberry Pi is the next step after installing Android TV. Using a USB thumb drive, transfer the GApps package (a ZIP file) from your computer to the Raspberry Pi.

On-screen flashing of the gapps package
On-screen flashing of the gapps package

2. Open Settings -> Device Preferences -> About -> Google Play Services. Make your way to the bottom of the menu and select Build. Then, press the “Build” button 7-8 times in rapid succession. It will enable Android TV’s Developer Options.

This is the serial number of the Raspberry Pi Android TV.
This is the serial number of the Raspberry Pi Android TV.

3. Next, return to the Device Preferences menu and look for the bottom section. “Developer Options” can be found here. It’s yours once you’ve cracked it open.

navigate to the Developer menu
navigate to the Developer menu

4. Select “Advanced Reboot” from the menu.

allow for a more thorough reinstall.
allow for a more thorough reinstall.

5. Open Settings -> Device preferences -> Reboot -> Recovery in order to restart Android TV on the Raspberry Pi. TWRP Recovery can be accessed through this link.

Restart the healing process.
Restart the healing process.

6. The TWRP recovery will now boot up. “Swipe to Allow Modifications” if necessary. Open “Install” after that.

use twrp recovery to install ZIP
use twrp recovery to install ZIP

7. Here, select the GApps package that we transferred to the Raspberry Pi.

Raspberry Pi Android TV: flash the open gapps package
Raspberry Pi Android TV: flash the open gapps package

8. Click “Swipe to confirm Flash” to complete the installation.

Verify flashing lights
Verify flashing lights

9. To get to the main menu, click on the TWRP icon at the top-right of the screen. Wipe -> Swipe to Factory Reset is where you’ll find the option to reset your device.

Reset Android TV to factory settings.
Reset Android TV to factory settings.

10. To restart the computer, go back to Step 10 and click “Reboot” 10.

eactivate the Android TV device.

11. Your Raspberry Pi will now boot directly into Android TV. You’ll be prompted with the Google Setup again this time. Follow the on-screen directions from here on out. In light of recent policy violations by Google, I recommend that you do not link your primary Google account. Press “Esc” on the keyboard if you get a popup asking you to set up a remote. You can also use the remote option for on-device Google login if you get an error.

Google's Android TV service
Google’s Android TV service

12. There you go. All of Google’s services, including Play Store and Chromecast, are fully functional on your Raspberry Pi-based Android TV. In the event that your Chromecast isn’t working or Netflix isn’t available, follow the instructions below.

Android TV with Google Apps pre-installed.
Android TV with Google Apps pre-installed.

Also read: Android Apps Popular With Users Vs iPhone Users

Fix Chromecast on Android TV Boxes based on Raspberry Pi.

There’s no need to panic if your Raspberry Pi’s Chromecast isn’t working. You can enrol your custom Android TV in Google’s list of certified devices by yourself. – The first step is to download and install the Evozi’s Device ID app on the Raspberry Pi (Play Store / APKMirror). You’ll have to sideload this app because the Play Store on Android TV doesn’t have it.

Fix Chromecast on Android TV Boxes based on Raspberry Pi.
Fix Chromecast on Android TV Boxes based on Raspberry Pi.

2. Second, open the Device ID app, which will show you the Google Service Framework source code (GSF). The code can be copied by clicking on it.

Copying the gsf identifier
Copying the gsf identifier

3. Open Google.com/android/uncertified on your computer or Raspberry Pi and sign in with the same Google account you used on the Raspberry Pi. Afterwards, type in the GSF code and press “Register“. Finally, you’ve achieved your goal. Chromecast should begin working after 5 to 10 minutes of waiting.

On Google's Certified Devices website, you can register an uncertified device.
On Google’s Certified Devices website, you can register an uncertified device.

4. When all else fails, reboot your RPi-powered Android TV. Restart the computer by pressing and holding the F5 key. Chromecast should work fine this time around..

fix chromecast by restarting android tv
fix chromecast by restarting android tv

5. As a final step, you can tweak your Android TV using the Raspberry Pi settings in the Android TV Settings menu.

settings for the raspberry pi
settings for the raspberry pi

6. In fact, your Raspberry Android TV set-up can be equipped with an IR remote control. To control Android TV with an IR remote, simply turn on the Infrared remote toggle. The developer’s documentation is the best place to go for more information.

use an ir remote control with an android tv and a raspberry pi
use an ir remote control with an android tv and a raspberry pi

Make Your TV Smarter by Installing Android TV on a Raspberry Pi.

You can now install Android TV on a Raspberry Pi and use it as an Android TV stick or box. As long as you’re patient and stick with it, you’ll be fine with it. Even the most recent Android 11 build worked flawlessly in my hands-on tests. Try it out, if you like.

Let us know if you have any questions or concerns in the comments section below.

Leave a Comment