Android on the Raspberry Pi using LineageOS

Learn how to install the Android operating system to the Raspberry Pi by using LineageOS.

Raspberry Pi Android using LineageOS

To get Android to run on a Raspberry Pi, we will be using a special build of LineageOS developed by konstakang.

LineageOS is an open-source operating system that is built upon the Android platform.

Both the Raspberry Pi 3, 4 and 5 builds of Android have support for hardware-based rendering.

Having support for the hardware renderer allows Android to make full use of the GPU built into the Raspberry Pi. This helps maximize performance when running things like games on your device.

The only feature missing from these builds of Android is support for hardware decoding and encoding of video. You may experience some slowdowns when trying to play video files through Android.

You will need to have a Raspberry Pi 5, Raspberry Pi 4, or a Raspberry Pi 3 to install this version of Android. These builds do not currently support older versions of the Pi.

Alternatively, you can also use the Android TV builds for the Raspberry Pi. These are very much like the standard version of Android but sport a different user interface.

If you want an alternative way of getting Android to run on your Raspberry Pi you can always try out EmteriaOS.

Equipment List

For this guide on installing Android on your Raspberry Pi, we recommend that you have the following parts.

Recommended

Optional

We tested our Raspberry Pi Android tutorial on a Raspberry Pi 4 running the latest available version of LineageOS.

Preparing to install Android to your Raspberry Pi

In this section, we will be downloading everything you need to run Android on your Raspberry Pi.

You will learn where to download the LineageOS for the Raspberry Pi as well as the Google Apps.

Downloading Android for the Pi

As mentioned earlier, we will be making use of special versions of LineageOS that have been modified by developer Konstakang to work on the Raspberry Pi.

The developer has provided three versions of the operating system, one for the Raspberry Pi 3, one for the Raspberry Pi 4 and one for the Pi 5.

To respect the developer’s wishes, we have provided links to his official pages to download the Android buildss

Raspberry Pi 5

If you are running a Raspberry Pi 5 you can download Android 14 (LineageOS 21) for it by visiting the Konstakang Pi 5 download page.

Raspberry Pi 4

You can download LineageOS 21 (Android 14) for the Raspberry Pi 4 by going to the KonstaKANG Pi 4 download page.

Raspberry Pi 3

Likewise, you can find the download page for the Raspberry Pi 3 version of LineageOS 17.1 on the same website.

The Raspberry Pi 3 build is currently built upon Android 10.

If you appreciate the work done by the developer on getting Android to run on a Raspberry Pi, consider making a donation through their website.

Downloading Google Apps for Android

As LineageOS does not come with the Google Apps pre-installed, we will need to install them manually.

1. To download Google Apps, we need to go to the OpenGAPPS website.

This website provides packages containing all of the Google Apps that you require to get the Google Play Store running on your Raspberry Pi.

2. On this page, you will need to select a few options to download the correct version of the Google Apps for Android.

Under the platform column, you will need to select the ARM option (1.).

Next, you will need to select the version of Android you are targeting. In our case, this is Android 10.0, so select 10.0 (2.).

The final option allows you to select the version of the Google Apps that you want to download. For our uses, we are going to choose pico (3.).

This variant contains the minimum amount of packages needed to run Google Play.

Finally, you can download the generated package by clicking the download button (4.).

downloading gapps for Android 10


Once downloaded, copy this file over to a USB and plug it into your Raspberry Pi. We will install the Google Apps later on in this guide.

Flashing Android to your Raspberry Pi

Now that we have both Android and the Google Apps downloaded, we can now proceed with this guide.

In this section, we will be showing you how to flash your newly downloaded LineageOS image to a Raspberry Pi.

To write this image to the SD card, we will be making use of the image writing tool called Etcher. However, you can use other image writing tools.

1. With the Etcher software opened, you need to click the “Select Image” button.

This button will bring up a file dialog box that will allow you to select the Android image that you downloaded earlier.

Select Android Image to write

2. Next, you will need to select the SD Card that you want to write the Android image to. Click the “Select target” button to select your SD Card.

If you only have one writeable device plugged in, the Etcher software will automatically select it.

Select Drive to Write Android To

3. Finally, click the “Flash!” button to begin writing the image to your SD card.

Flash Android to Raspberry Pi

First Boot of Android on your Raspberry Pi

Once you have flashed your LineageOS image to your Raspberry Pi’s SD card, we can begin the process of first booting up your device.

Please note that if you plan on installing the Google Apps, it doesn’t matter as much what you define here as we will need to factory reset our Android installation.

1. When you first boot up LineageOS on your Raspberry Pi, you will be greeted by the following screen.

To begin the initial set up procedure by clicking the “Next >” button in the bottom right corner.

Lineage Initial Setup Steps

2. Before being able to proceed with the setup process you will need to agree to this distributions EULA.

Basically this EULA prevents you from using KonstaKANG’s builds for commercial purposes.

To proceed, click the “Accept >” button.

Accept Android-RPI End User License Agreement

3. On the next screen, you will be able to select the language you want to use for your Android device.

You can use the option in the middle of the screen to select the language you want to use (1.).

Once you are happy with the setting, click the “Next >” button (2.).

Select Language for Android on your Raspberry Pi

4. Now let us set the time zone for our device using the dropdown box on the left-hand side of the screen (1.).

You can also use this setting to control the current date and time.

Once you have set your time zone, you can set it by clicking the “Next >” button (2.).

Set Android Time and Date

5. If you are not using an ethernet connection, this next screen will allow you to connect to your Wi-Fi.

Your Raspberry Pi should have already scanned for available Wi-Fi networks, click the network you want to connect to (1.).

Once connected, you can click the “Next” button to continue (2.).

Connect to WiFi within LineageOS

6. This screen allows you to enable or disable the various location services supported by LineageOS.

For simplicity, we left these options as the default and clicked the “Next >” button.

Configure Android Location Services

7. Now you can disable or enable some of the features of LineageOS.

Some of these features include the privacy guard that blocks apps from reading your contacts, messages, or call logs without approval.

Once you are happy with the settings, click the “Next >” button to continue with the setup.

Toggle LineageOS Features

8. Before you complete the setup, you will get the chance to restore an existing LinageOS backup.

If you have a backup that you want to restore, you can click the “RESTORE FROM BACKUP” button (1.).

Alternatively, you can click the “Next >” button to finish up your setup (2.).

Restore LineageOS Backup

9. This final setup page will allow you to set a PIN, pattern, or password for your Raspberry Pi powered Android device.

Please note that if you plan on installing the Google Apps, it is recommended to skip straight to the next step.

Otherwise, if you want to set a lock screen, click the “SET UP” button (1.).

If you would prefer not to set a password, click the “SKIP >” button (2.).

Protect your tablet Options

10. All you need to do to finalize your Android setup on the Raspberry Pi is click the “START >” button in the bottom right corner.

Initial LineageOS Setup Complete

11. Congratulations, you have now got LineageOS installed and set up on your Raspberry Pi.

Android Successfully running on the Raspberry Pi

In the next section, we will be showing you how you can install the official Google Apps to your device.

Installing the Gapps to your Raspberry Pi

In this section, we will be showing you how to install the Google Apps to your Raspberry Pi running Android.

There are a few different steps required to make this work as you will need to boot into recovery mode to install the Gapps package we downloaded earlier.

Before beginning this section, make sure that you have your USB with the GApps copied to it plugged into the Raspberry Pi.

Enabling Developer Mode on Android

For our first few steps, we will need to enable developer mode on our Android operating system.

Without developer mode, we won’t be able to boot our Raspberry Pi into recovery mode.

1. On the desktop of your Android device, click and drag up from the bottom three apps to bring up the app library.

Drag up to open app library

2. Within this menu, click the “Settings” app.

Open Android Settings App

3. Scroll down to the bottom till you find the “About Tablet” option and click it.

About Tablet Device Page Option

4. Within this settings page, scroll down to the bottom till you see the “Build Number” text.

You need to click this text (1.) until a message pops up notifying you that “You have enabled the development settings!” (2.).

It should only take 5 clicks to enable the settings.

Once done, return back to the settings menu by clicking the back button (3.).

Activating Developer Options

5. Scroll down to the bottom again and open the “System” settings page.

Open Android System Menu

6. To unhide the advanced settings, click the “Advanced” toggle at the bottom of this page.

Enable Advanced System Options

7. Scroll to the bottom till you find the “Developer options” and then click it.

Enter Developer Options Menu

8. There are two different options we will need to configure within this page.

First, scroll down till you see “Root access” and click it.

Enabling this option will allow apps on your Raspberry Pi full control over the Android operating system.

Enable Android Root Access

9. Finally, you will be warned about the possible implications of enabling root access on your Android device.

As we need root access, click the “OK” button.

Select OK to Allow Root Access

10. Next, we need to scroll down to the “Local terminal” option and click the toggle.

Enable the Local Terminal App

11. For the local terminal to appear, we will need to restart our Raspberry Pi using the Android interface.

To bring up the power options menu, you will need to press the F5 key on your keyboard.

With the power menu loaded, click the “Restart” button.

Restart Android on Raspberry Pi

Booting into Recovery Mode

Due to the way the Raspberry Pi works with booting, we can’t get into the Android recovery mode as you do with a phone or tablet.

Instead, we will have to use a special bash script that will rename the partitions so that we can boot in and out of recovery mode.

1. First, we need to get back into the app library on our Android interface.

Again you can do this by dragging up from the bottom of the screen.

Drag up to open app library

2. Within this menu, you need to click the “Terminal” app.

Open Terminal App on Raspberry Pi Android Device

3. When you first open the terminal app, you will be asked to permit it to access files on your device.

To proceed, click the “Allow” button.

Allow Terminal to access Android files

4. Now before we can continue, we need to try and elevate our selves to superuser by typing the following into the terminal.

su

5. We can now finally enable the recovery partition for Android on our Raspberry Pi by entering one of the following sets of commands.

These commands differ slightly for the Raspberry Pi 4 and 3, so follow the options for your Raspberry Pi.

Raspberry Pi 4

rpi4-recovery.sh
reboot

Raspberry Pi 3

rpi3-recovery.sh
reboot
Reboot to Raspberry Pi Android Recovery Mode

Your Raspberry Pi should now reboot into the Android recovery mode provided by LineageOS.

Installing Google Apps in Recovery Mode

Finally, we can now install the Google Apps to our Raspberry Pi powered Android device.

For this section, make sure that you have your USB with the gapps package plugged into your Raspberry Pi.

1. As the recovery mode needs to adjust our system partition, swipe the option in the bottom right corner.

Allow Recovery to Modify System

2. We need to start by mounting our USB storage device.

To get to the mount menu, click the “Mount” button.

Go to Recovery Mount Options

3. Within this menu, make sure that you have the “Boot“, “System“, “Data” and “USB-OTG” partitions selected to be mounted (1.).

Once you have them all selected, click the “Select Storage” button (2.).

Mount USB Device to Android Recovery

4. You will now see a dialog menu asking you to select the storage device you want to use.

Click the “USB-OTG option, as this is where our Google Apps package currently sits (1.).

Once selected, click the “OK” button.

Select USB as Storage Device to access

5. Now return to the Android recovery home page by clicking the home icon at the bottom of the screen.

Return Back to Recovery Main Menu

6. We can now install the GApps package we downloaded earlier on in this guide.

To do that, we need to go into the “Install” menu.

Install packages through recovery menu

7. Within the install menu, click the “open_gapps” package to begin the installation process.

Select Google Apps Zip to write to Android Pi

8. To confirm writing the Google Apps package to your Raspberry Pi powered Android device, you need to swipe to confirm the flashing operation.

The installation process should be completed reasonably quickly.

Swipe to Flash Google Apps

9. Once the Google Apps has finished being written to your Raspberry Pi, click the home button at the bottom of the screen.

Successfull Installation of Google Apps

10. We now need to perform a factory reset of our Android installation.

To perform the reset, we need to click the “Wipe” menu.

Go to Recovery Wipe Menu

11. Within the wipe menu, all we need to do is swipe the toggle in the bottom right corner.

Swiping this option will begin the factory reset process of the Android operating system running on our Raspberry Pi.

Swipe to Factory Reset Raspberry Pi

12. Once the Android recovery software has finished resetting the operating system, we can now restart the device.

To restart our Raspberry Pi we can , click the “Reboot System” button.

Restart After Factory Reset

Setting up your Google Account

As we performed a factory reset, we will need to go back through some initial configuration steps.

These steps include connecting your Google account to your Raspberry Pi Android device.

1. Straight up, you will get a chance to specify the language that you want to use (1.). By default, this is set to English.

Once you are happy with your language settings, click the “START” button to start the setup process.

2. As it is our first time starting up the Raspberry Pi with the Google Apps and Android installed, it will want to check and install updates.

This process can take some time, so please be patient. It will complete after a few minutes.

Updating Google Apps

3. You can now choose whether you want to copy apps and data to your new Android device.

For this tutorial, we will be selecting the “DON’T COPY” option (1.).

However, if you want to copy over data, click the “NEXT” button (2.).

Copy Apps and Data to Raspberry Pi Android Device

4. On this page, you will be asked to connect your Google account.

File in your email or phone number within the text box (1.).

Once you have entered your account details, click the “Next” button (2.) and follow the prompts to login to your account.

Login to Google Account

5. To finalize connecting your Google account to your Android device, you will need to agree to some terms and conditions.

Once you have read through the terms of service, click the “I agree” button.

Agree to terms to add Google Account

6. You can now switch certain Google services on and off.

Once you have configured each service, scroll to the bottom, and click the “ACCEPT” button.

Enable or Disable Google Services

7. On this page, you can configure your device to require a password to be used.

For simplicity, we will be continuing this tutorial by selecting the “Not now” option.

Set a security method for your Pi Android

8. This screen will allow you to adjust the font size or change the wallpaper of your device.

As you can configure these through settings at a later stage, we will just click the “NO THANKS” option to continue.

Extra Android Settings

9. Finally, we can once again configure LineageOS features.

Once you are happy with your settings, click the “Next >” button.

 Set LineageOS Features after GApps install

10. Now, we can return to the Android launcher by clicking the “START >” button.

LineageOS Finished Setup with GApps

11. You should now successfully have Android running on your Raspberry Pi with the Google Apps installed to it.

You will now be able to open up the Google Play store and install apps from it.

Android on Raspberry Pi With Google Apps Installed

Hopefully, at this stage, you will now have successfully got Android up and running on your Raspberry Pi.

Be sure to also check out some of our other Raspberry Pi projects such as our Pi Plex Server.

If you have run into any issues with this guide, post a comment below, and we will try our best to help if we can.

Leave a Reply

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

14 Comments

  1. Avatar for Frank M Waterman
    Frank M Waterman on

    Hello Emmet!
    I appreciate you taking the time and making the effort to prepare this nifty ‘how-to’ on the installation and configuration of LineageOS on Raspberry Pi. Thank you.

    I hate to offer any criticism of your Herculean effort, however in LineageOS 21, there is no longer a boot unlocking switch within the Developers options. Not sure why, but it’s not there any longer! I’m thinking this is a significant enough change that you might want to consider clarifying this in your piece, lest others become as confused as I was!😜
    That’s my only criticism. Thanks once again πŸ˜ŠπŸ‘

    1. Avatar for Emmet
      Emmet on
      Editor

      Hi Frank,

      Thank you for the heads up about this. I have added it to my to-do list of tutorials I need to go back over and add better / improved steps.

      Kind regards,
      Emmet

  2. Avatar for James
    James on

    Hi,
    I have a Argon ONE V1 case for Pi4.
    When I installed the android into Pi4, it became very hot (Fan was not working).
    I can find the script for RetroPie, LibreELEC and KDE OS…
    However, I just can’t find the script for Android, could you please let me know the script for android if you know.
    Thank you for your help.

    1. Avatar for Emmet
      Emmet on
      Editor

      Hi James,

      This is sadly not something I have any experience in.

      Looking around it doesn’t appear as if Argon provides any support for Android. As I don’t personally own the case, you would have to look into using the I2C tools included with this build to enable the fan.

      The Argon team look like they at least provide details about the I2C codes needed to interact with the fan, https://github.com/Argon40Tech/Argon-ONE-i2c-Codes.

      Cheers,
      Emmet

  3. Avatar for ramutran
    ramutran on

    very clearly guideline

  4. Avatar for Michael
    Michael on

    Is there a way to rotate the screen to landscape? I use this to monitor several security cameras simultaneously and would like to see it in landscape. Thanks for the great work.

    1. Avatar for Emmet
      Emmet on
      Editor

      Hi Michael,

      I believe there is a setting located within Android that will let you choose the screen rotation.

      Should be able to go to Settings -> System -> Advanced settings, then there should be a setting within there from what I’ve read.

      Will re-install Android and check this later if you can’t find it.

      Cheers,
      Emmet

  5. Avatar for Homestead
    Homestead on

    Hi, I did this process, and it works perfectly! I just have 1 quick question, would you be so kind as to give me an explanation of how to set up a 3.5 in. touchscreen with this?
    It would be greatly appreciated!

    Thank You!

  6. Avatar for Micah
    Micah on

    Hi, so I was installing lineage OS 14.1 (android 7.1) in my raspberry pi 3B. Android 7.1 runs much faster than android 10 on this model. I got lineage OS running fine on it but when I got into recovery mode to install Gapps, it would not leave recovery mode. The Gapps installation seemed to have gone smoothly, but now every time I hit reboot it just boots back into recovery! Do you have any fixes?

    1. Avatar for Emmet
      Emmet on
      Editor

      Hi Micah,

      The older versions of Android provided by Konstakang requires a bit more work to boot out of.

      You will need to flash a file while in recovery to boot back into Android. You can find this file at https://www.androidfilehost.com/?fid=1322778262903982323

      Cheers,
      Emmet

  7. Avatar for Jac Cremers
    Jac Cremers on

    Hi Emmett, a small improvement suggestion. I noticed i have only limited space available on my 64GB SD-card. Something like 5GB is free. I guess some space on the SD-card is not accessible. Can you include some hints how to add the unused space. Many thanks, Jac

    1. Avatar for Emmet
      Emmet on
      Editor

      Hi Jac,

      The developer behind the Raspberry Pi builds of Android has a package that you can flash that expands the size of the data partition on his website.

      I will hopefully update this guide shortly to include the steps on how to do this. I am just currently writing a guide on how to install Android TV to your Raspberry Pi.

      Cheers,
      Emmet

  8. Avatar for Jac Cremers
    Jac Cremers on

    Hi Guys,

    When I saw this setup description I immediately wanted to install it but unfortunately I got stuck in the Google apps setup. I think my version of the system doesn’t support anymore the root access, the option didn’t showed up on my screen. You know what to do now? Initially I setup a pin for the system but also when I removed the pin the option (root access) was still not available. Many thanks for your help,

    Regards, Jac

    1. Avatar for Emmet
      Emmet on
      Editor

      Hi Jac,

      We just updated the tutorial so everything should now be working correctly.

      You may have to try downloading the Android build we are currently linked to. I briefly updated it to Android 11 but there is a few things I need to sort out still, so it has been changed back to Android 10.

      I have also gone and updated all the steps to ensure they are correct.

      Let me know if you have any issues with the updated tutorial.

      Cheers,
      Emmet