How to Build an Android TV Box With a Raspberry Pi

Want to make a Raspberry Pi-based media center, but find that the basic Kodi install doesn’t offer enough features? Don’t worry, there is a tried and tested alternative: Android TV!

android-tv-raspberry-pi

Here’s how to install Android TV and enjoy the benefits of every popular streaming app that runs on Android, on your Raspberry Pi.

advertising

Android in a Box

This is a relatively straightforward project, requiring you to:

  1. Install a dedicated Android ROM on your Raspberry Pi
  2. Install some specific Android TV software
  3. Start watching TV

It really is that simple. If you know how to install an operating system to your Raspberry Pi, you shouldn’t have any trouble.

raspberry-pi-os

Before you get started, make sure you have:

  • A Raspberry Pi 3 (currently no support for Pi 3 B+ or Pi 4)
  • A good quality microSD card
  • Reliable Raspberry Pi power supply
  • USB keyboard and mouse (or combi remote)
  • USB flash drive
  • HDMI cable
  • Ethernet cable (optional)

You’ll also need the following software downloads:

Ready to start? Let’s go.

advertising

Step 1: Unpack and Install Android

Installing LineageOS on your Raspberry Pi gives you the benefit of the Android operating system. This means potentially better support for media software, such as YouTube and Kodi. With the right Google apps installed, however, your Android powered Raspberry Pi makes a great Android TV.

This is possible with various versions of Android for Raspberry Pi (one of which we’ve looked at previously), but for the best results, use the LineageOS version linked to above. Before proceeding, ensure the ZIP file is unpacked.

Install Android on the Raspberry Pi With Etcher

To install, first insert your Raspberry Pi’s microSD card into your PC card reader and run Etcher.

Here, click Select image and browse to the unzipped image file. Select this, then ensure your SD card is selected under Select drive. Once you’re satisfied, click Flash to commence writing the Android disk image.

advertising

Install Android on the Raspberry Pi with Etcher

Wait for writing to finish—Etcher will inform you when the process is complete—then eject the SD card. Insert it in your Raspberry Pi, then boot up.

On the first run, it may take for Android a little while to load. Once running, if you have a keyboard and mouse to hand, set up Wi-Fi. If not, connect your Raspberry Pi to your network by using an Ethernet cable hooked up to your router.

Following installation and a successful boot, LineageOS will require basic configuration. This will just be the usual stuff: set country, time zone, etc.

Step 2: Prepare Android TV for Google Apps

Your Raspberry Pi is now running Android. This is a version based on AOSP which means that no Google apps are installed. Instead, you will need to do this manually.

You should have already downloaded the GApps package to your PC. Visit opengapps.org and select:

advertising

(It’s tempting to select the Android TV option rather than Pico—don’t. This is simply a larger file, and doesn’t really do anything other than cause problems down the line.)

Select Download, then when the GApps file is saved to your PC, copy it to your USB flash stick. Safely remove this and insert it into your Raspberry Pi.

Next, on LineageOS, open the app drawer and select Settings > System > About tablet. Here, scroll down to Build number and click it repeatedly. Eventually, this will add the Developer options menu to the previous screen.

Click back until you’ve exited the Settings app, then reopen it and navigate to System > Developer options. Select Root access and choose the Apps and ADB option, clicking OK when the warning is displayed.

Next, scroll down to Local terminal and enable the app. This gives you local shell access, which means you can enter commands via the keyboard.

advertising

Head back to the app drawer, where you will find the Terminal app. Click to open and Allow the app permissions to access your device.

Next, enter the superuser command:

su

A Privacy Guard warning box will appear. Check Remember my choice (to ensure future permission for what you’re about to do) and then Allow.

Next, enter the command

rpi3-recovery.sh

This loads the recovery script. Enter the reboot command to launch it.

reboot

The Raspberry Pi will boot into the TWRP recovery console. Here, select Install, then Select Storage to choose your USB flash device.

Select your USB device to install GApps

Select the GApps file, then Install Zip, and in the next screen check Reboot after installation, then Swipe to confirm Flash.

Flash Google Apps GApps package on Raspberry Pi

When the device reboots, you should be able to access the Play Store.

Step 3: Configure Your Android TV Interface

So far, you’ll notice that the interface on LineageOS on your Raspberry Pi basically looks like Android, not Android TV. To change this, you’ll need a launcher.

advertising

Several are available; we used an ad-supported launcher, ATV Launcher Free from the Play Store. Simply sign in with your usual Google account, search for it, and install. (Note that your initial sign-in to the Play Store will take a few moments to complete thanks to verification steps.)

Android TV Launcher running on Raspberry Pi

With the interface sorted, you’ll need to add some useful media apps. Things like YouTube, Plex, Amazon Prime Video, Kodi, and more work, and are all available on Google Play. Simply install these as usual to get the benefit of your existing subscriptions.

Note: Performance of these apps has proven mixed at best. For the best results, stick to YouTube. If you’re looking for other apps, research to find the best versions to install.

Step 4: Controlling Android TV on Raspberry Pi

With everything up and ready, you will probably want to disconnect your mouse and keyboard in favor of something lightweight. Several remote options are available for the Raspberry Pi, which should work with Android TV.

advertising

One option is the Mini Wireless Keyboard/Air Remote Control which is combination device with configurable LED backlight.

Alternatively, you might prefer the iPazzPort Wireless Mini Keyboard with Touchpad. This combines the keyboard and touchpad along with a D pad and media controllers into one unit.

Both devices are wireless and ship with a dedicated Wi-Fi dongle specifically keyed to remote controls.

By now you should have a Raspberry Pi 3 or later pumping out videos and music using the LineageOS with an Android TV user interface. To all intents and purposes, you have an Android TV box!

Admittedly, you may run into trouble with performance, so ensure your microSD card is up to scratch. Also, check you’re using an approved Raspberry Pi power supply. This will ensure the Pi gets the power it needs without risking undervoltage and microSD card corruption.

advertising

Like the feel of Android TV but aren’t getting the best results? Consider our list of the best Android TV boxes.

We hope you like the items we recommend! MakeUseOf has affiliate partnerships, so we receive a share of the revenue from your purchase. This won’t affect the price you pay and helps us offer the best product recommendations.

Zoom Video Calls Thanksgiving

Thanksgiving Is Saved! Zoom Lifts Time Restriction on Turkey Day

About The Author Christian Cawley (1414 Articles Published)

Deputy Editor for Security, Linux, DIY, Programming, and Tech Explained. He also produces The Really Useful Podcast and has extensive experience in desktop and software support. A contributor to Linux Format magazine, Christian is a Raspberry Pi tinkerer, Lego lover and retro gaming fan.

More From Christian Cawley advertising

Subscribe To Our Newsletter

Join our newsletter for tech tips, reviews, free ebooks, and exclusive deals!

One More Step…!

Please confirm your email address in the email we just sent you.

.

Source

Leave a Reply

Your email address will not be published. Required fields are marked *