Installing Android on Raspberry Pi is a dream that is difficult to achieve. Perhaps you’ve already tried, but were unsuccessful. Me too, many times :).
I already created a tutorial on this topic using Emteria and a Raspberry Pi 3. But Emteria is a paid software, and the whole system was a bit slow and unstable on Pi 3.
How does it work now with a better Raspberry Pi and OS? We’ll see learn about this in today’s post.
Konstakang has created a custom image of LineageOS, an open-source version of Android, that can be installed on Raspberry Pi 3 and 4. Google Apps can then be added on the SD card to have a complete Android version running on Raspberry Pi.
In this tutorial, I will guide you through all of the steps with LineageOS, which is a good alternative to run Android on Raspberry Pi 4.
Edit: I recently tested this Android version with a touch screen for Raspberry Pi (I have this one from SunFounder to be precise), and it works very well. Android is designed for touch devices, so it makes sense :).
What is LineageOS?
LineageOS is a free and open source operating system, like most new systems I introduce on this website.
The first thing to understand, LineageOS is made for smartphones and tablets, it’s not an emulator or something specially dedicated to single board computers.
LineageOS was created in 2016, and is a fork from CyanogenMod.
LineageOS comes with a few basic applications (browser, calendar, calculator, etc.), but it doesn’t com with any Google applications or any useless preinstalled software.
If you are interested, you can get further information on their website.
Does it work on Raspberry Pi?
As you can imagine, I will not write about something that doesn’t work on Raspberry Pi on this site :).
So yes, there is a way to make it work on your Pi, but it’s not with the official release.
As you can see on the download page here, LineageOS is available for many devices (Samsung, Huawei, Sony, etc.), but not for anything other than smartphones and tablets.
However, there is an unofficial version available on this website for Raspberry Pi 4.
It’s not the latest LineageOS version (it’s Android 11 at the time of writing), but it’s good enough for the moment.
So, I’ll show you how to install this version on your Raspberry Pi 4.
There is also a version available for Raspberry Pi 3 if you use this model.
One good idea is to use it with a touch screen.
This way you can get a real Android tablet for cheap.
As explained in the Introduction, I have tested it with a 7″ one from SunFounder, and it works really well (you can read my review here).
Install Android on Raspberry Pi
Ok, so you’ll need to download several things before starting the installation process.
It’s not always easy to download it directly from Raspberry Pi, so I recommend downloading it from your computer.
I will explain what to do with each file later.
So, download all these files on your computer:
- Balena Etcher.
We’ll use it to flash the SD card. It’s available on any operating system.
You may already have it or prefer another tool, which isn’t a problem.
- LineageOS for Raspberry Pi 4 or LineageOS for Raspberry Pi 3.
The alternative to install Google Apps on a custom Android device.
Choose the ARM platform, the corresponding Android version and the “pico” variant:
I recommend copying the “OpenGapps” file to a USB key.
It’s easier than downloading it from the Android system.
I’ll show you in the last part how to install them.
Flash the SD card
Next, we need to prepare the SD card.
As usual, I’m using Etcher to do this:
- Install Etcher if not already done.
- Start it, you’ll get something like this:
- On the left, pick the LineageOS image file from your Downloads directory.
Then insert your SD card in your computer, Etcher should select it automatically.
And finally click on “Flash!” to start the copy.
A few minutes later, your SD is ready and you can insert it in your Raspberry Pi.
Boot on LineageOS
Start your Raspberry Pi.
The first boot will take a bit longer, probably to configure everything.
Once done, you get a first wizard to finish the setup:
Choose your language, time zone and wireless connection.
Then you can configure the other options as you want (privacy, security, etc.).
Once done, the Android desktop shows up.
Depending on your goal, you can start working with the basic apps (browser, file browse, etc.).
To access them, scroll up the bottom bar.
But you’re probably not here to only use the email and browser apps, so let’s move to the Google Apps installation.
Install Google Play Store on Android
This is always the most complex part on an Android installation, for any device or system.
As we don’t use an official Android image and device, there are additional steps to enable Google Play Store.
Enable Developer options
We’ll need to go in recovery mode to install additional packages.
To do this, we need to enable developer options and run a command as root.
Let’s do this:
- Go into the Settings.
- Go to the end of the list (with the keyboard arrows) to find and click on “About Tablet”.
- Then find “Build number” and click on it several times.
After about five clicks, a message appears to say that you enabled the developer options.
- You can now come back to Settings and open the “System” menu.
In the “Advanced” part, there are the developer options.
- From here, there are two things to enable:
- Local terminal.
We’ll need to use a command to reboot in recovery mode.
- Root access, we need it to run the command.
Choose “Apps and ADB” in the list.
- Local terminal.
- Reboot the Raspberry Pi.
Press and hold F5, and click on “Restart”.
Note: With Android 11 / LineageOS 18, there is no “Root access” option. You need to download this add-on first. Download it directly on your Raspberry Pi, and reboot in recovery mode to install it (Hold F5 if you have a keyboard, then choose Restart > Recovery). You may need to enable the advanced power menu buttons in your settings to have this option.
Ok, you are ready to move to the next part.
We now need to go in recovery mode.
Reboot in recovery mode
Back in Android, you should see a Terminal app available:
Open it and enter the following commands:
Note: If the rpi4-recovery.sh script is not available in the terminal, you need to download this file from Konstagang.
Allow all asked permissions.
If you are on Raspberry Pi 3, there is probably an equivalent, something like:
The system will now reboot on recovery mode.
Swipe to allow system modifications, you should get this screen:
We can now move to the Google Apps installation.
Install Google Apps
Once in recovery mode, plug in your USB key with Google Apps on it.
Then follow this procedure:
- Click on “Mount”.
This is where you can choose which partition to mount.
We need to mount the USB key, so check it in the list (USB-OTG in my case, I don’t know if it’s my USB key model or always this).
- Then, back on the main menu, click on “Install”.
- Click on “Select Storage” and choose the USB key.
- Finally, your files appear.
Click on the Open Gapps file to install it:
Swipe to confirm, there is nothing else to change.
- Don’t reboot after the installation, as it will come back to the recovery mode.
If everything is OK, you can now restart in normal mode, check the next part.
Reboot in normal mode
To enable the recovery mode, we also need to run the command to change the boot to normal mode.
- From the recovery mode menu, go into “Mount”.
Ensure that the boot partition is checked.
- Then go to Advanced and Terminal.
- Enter almost the same commands:
Note: From Android 10 and over, the rpi4-recovery.sh script is no longer available in the terminal, you need to download this file from Konstagang.
Put it on the same USB key with Gapps, and install it just after Gapps.
It will reboot in normal mode.
That’s it, your Raspberry Pi will now restart in normal mode.
Once on the Android desktop, you can see that Play Store is available in the apps.
Sale: 10% off today.
Get the eBook.
Do more with your Raspberry Pi, learn the useful concepts and take the shortcuts.
You miss half of the fun of using a Raspberry Pi if you don’t know anything about Python.
Sign in on Play Store
The last step is to sign in on Google Play, as you would for any Android device.
Open the Play Store app and try to sign in with your Google account:
You may get some error messages during this process, asking if you want to close or wait:
Keep choosing “Wait” until you manage to log in.
Once logged in, you can close the app and reboot the device.
After the reboot, everything should be fine.
You can now install any app or game you want on your Raspberry Pi :).
I have recorded the process in video simultaneously. You can watch it here if you want:
Check the RaspberryTips YouTube channel to receive new videos in your feed:
Recommended stuff for Android on Raspberry Pi
- Raspberry Pi 4: If you don’t have one yet, I highly recommend switching to the fastest Raspberry Pi model available. Android is still a bit slow on any other model.
- SSD drive: If you want better performances, a Raspberry Pi and a SSD allows you to run systems really fast. My favorite model is this one. SSD drives are now really affordable, go for it! (USB adapter included).
- Touch screen: Android is built to use on a tactile screen, this one is cheap and allow you to have a better experience with your new Android system.
That’s, we finally found a way to have Android working better than ever on Raspberry Pi
And it’s not so difficult to install, we don’t need any account (except from Google), and it’s free 🙂
I didn’t play with it too much after that, so if you have any other opinion or issue, let me know in the comments below
Raspberry Pi Resources
Not sure where to start?
Understand everything about the Raspberry Pi, stop searching for help all the time, and finally enjoy completing your projects.
Watch the Raspberry Pi Bootcamp course now
Master your Raspberry Pi in 30 days
Don’t want the basic stuff only? If you are looking for the best tips to become an expert on Raspberry Pi, this book is for you. Learn useful Linux skills and practice multiples projects with step-by-step guides.
Download the e-book
If you just want to hang out with me and show your support, you can also join the Patreon community. I share behind-the-scenes content there and give you early access to my content. You’ll also get a shoutout when you join.
More details here
Need help to build something with Python?
Create, understand and improve any Python script for your Raspberry Pi.
Learn the essentials, step-by-step, without losing time understanding useless concepts.
Get the e-book now
You can also find all my recommendations for tools and hardware on this page.