*Credits to pimylifeup.com
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 and 4 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 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.
For this guide on installing Android on your Raspberry Pi, we recommend that you have the following parts.
Ethernet Cord or WiFi dongle (The Pi 3 and 4 has WiFi inbuilt)
We tested our Raspberry Pi Android tutorial on a Raspberry Pi 4 running the latest available version of LineageOS.
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.
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 two versions of the operating system, one for the Raspberry Pi 3 and one for the Raspberry Pi 4.
To respect the developer’s wishes, we have provided links to his official pages to download the Android builds.
You can download LineageOS 17.1 (Android 10) for the Raspberry Pi 4 by going to the KonstaKANG Pi 4 download page.
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.
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.).
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.
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.
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.
3. Finally, click the “Flash!” button to begin writing the image to your SD card.
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.
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.
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.).
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.).
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.).
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.
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.
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.).
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.).
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.
11. Congratulations, you have now got LineageOS installed and set up on your Raspberry Pi.
In the next section, we will be showing you how you can install the official Google Apps to your device.
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.
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.
2. Within this menu, click the “Settings” app.
3. Scroll down to the bottom till you find the “About Tablet” option and click it.
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.).
5. Scroll down to the bottom again and open the “System” settings page.
6. To unhide the advanced settings, click the “Advanced” toggle at the bottom of this page.
7. Scroll to the bottom till you find the “Developer options” and then click it.
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.
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.
10. Next, we need to scroll down to the “Local terminal” option and click the toggle.
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.
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.
2. Within this menu, you need to click the “Terminal” app.
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.
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
Your Raspberry Pi should now reboot into the Android recovery mode provided by LineageOS.
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.
2. We need to start by mounting our USB storage device.
To get to the mount menu, click the “Mount” button.
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.).
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.
5. Now return to the Android recovery home page by clicking the home icon at the bottom of the screen.
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.
7. Within the install menu, click the “open_gapps” package to begin the installation process.
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.
9. Once the Google Apps has finished being written to your Raspberry Pi, click the home button at the bottom of the screen.
10. We now need to perform a factory reset of our Android installation.
To perform the reset, we need to click the “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.
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.
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.
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.).
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.
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.
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.
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.
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.
9. Finally, we can once again configure LineageOS features.
Once you are happy with your settings, click the “Next >” button.
10. Now, we can return to the Android launcher by clicking the “START >” button.
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.
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.