I installed Android on a Raspberry Pi – Here’s how I did it – XDA Developers

I installed Android on a Raspberry Pi – Here’s how I did it – XDA Developers

With major improvements to their computing prowess, the new Raspberry Pi cards are capable of running some of the most popular Linux distributions and even the ARM version of Windows 11 without major performance issues. But if you’re tired of the same desktop interface, you can choose to run Android on these small systems. And not just any version of Android; thanks to the efforts of developer KonstaKANG, it is possible to install the latest version of the Android operating system on tiny Raspberry Pi boards.


Raspberry Pi 5 review: The holy grail of DIY projects just got better (and rarer)

The Raspberry Pi 5 is one of the most powerful consumer SBCs on the market. Unfortunately, its stock is limited, you will have difficulty finding one.

What you will need

A Raspberry Pi card is mandatory for obvious reasons, and an RPi 3 will suffice for those who don’t mind running an outdated copy of Android. That said, Android 14 is only available on the Raspberry Pi 4 and 5 models, so you may need to upgrade to a newer RPi model if you want to install the latest version of Android.

Besides the palm-sized system, you’ll need a microSD card and I recommend buying one with at least 8GB of space. This way you can install your favorite Android apps without running out of storage.

Flash LineageOS/AOSP files

Assuming you’re using a Raspberry Pi 4 or 5, KonstKANG’s repository provides links to the LineageOS and AOSP versions of Android 14. We’ll be using the stock Android version of LineageOS for this tutorial.

1. Start by downloading the portable version of Balena Etcher from the official website.

2. Go to the KonstKANG website, hover your cursor over the Devices tab and choose your Raspberry pie model.

A screenshot from the KonstaKANG website showing the Raspberry Pi model selection procedure

3. Download the version of Android you want to use with your Raspberry Pi. Be sure to extract it afterwards.

4. Run Balena engraver as administrator.

5. Select Flash from filechoose the .img file you extracted earlier and press Open.

The procedure to select LineageOS img file in Balena Etcher

6. Click on Select storage before choosing the microSD card to which you plan to flash the operating system files.

The procedure to select microSD card in Balena Etcher

7. press the Flash button.

The procedure to flash LineageOS image using Balena Etcher

Booting into Android for the first time

In the same way that you would configure Ubuntu or Windows 11 on the Raspberry Pi, you will need to configure some settings when you first launch Android on the SBC.

1. Insert the microSD card into the Raspberry Pi and connect all necessary cables before powering on the SBC.

2. Press To start on the welcome screen.

The LineageOS welcome screen

3. Accept the End User License Agreement.

4. Choose it Language and click on the Following button.

The Language option in LineageOS

5. If you have not connected an Ethernet cable, click on your Wireless network and enter its Password before pressing Following.

Wi-Fi settings in LineageOS

6. Put it on Date and hour settings, then click Following.

Date and time settings in LineageOS

7. Hit Following once you have finished customizing the Location settings And LineageOS Features.

The procedure to activate LineageOS features

8. LineageOS will ask you to protect your tablet and recover data from another device.

The Protect your tablet page with the Skip button highlighted

You can override these settings by clicking Jump.

9. If you use a keyboard and mouse, be sure to choose 3-button navigation before selecting Following.

The best navigation setting for keyboard and mouse users in LineageOS

ten. Click on the Following button two more times to complete the setup procedure.

(Optional) Installing Google apps

If you have followed all the steps correctly, the Raspberry Pi will boot to the LineageOS home screen. However, you will notice that the usual Google Play apps are not installed on your Raspberry Pi.

For beginners, I suggest saving yourself the hassle of installing GApps by switching to Aurora, F-Droid, or another app store. But if you’re a hardened veteran willing to endure a grueling ordeal to use Google’s suite of apps, read on.

1. Download the Arm64 version of BiTGApps from the Pling store.

2. Open it Settings application on your Raspberry Pi.

LineageOS with Settings app highlighted

3. Type power in the search bar and choose Power Menu Items from the suggestions.

Suggesting Power menu items in the LineageOS Settings app

4. Scroll down and enable the toggle next to Advanced restart.

The advanced restart option in LineageOS

5. Access Notification panel and click on the Power button.

The power button in LineageOS

6. Choose Reboot followed by Recovery.

The procedure to access the recovery environment in LineageOS

7. Select the Install tab inside the TWRP interface.

Install tab highlighted in TWRP

8. Access the Downloads folder and select the BiTGApps.zip deposit.

9. Swipe right to install the app.

The Swipe Confirmation Flash option is highlighted

ten. Make sure to select the Wipe Dalvik and restart your Raspberry Pi.

The Wipe Dalvik option in TWRP

After restarting the Raspberry Pi in Android, you will notice that Google Play displays an error message claiming that the device is not Play Protect certified. This means you won’t be able to sign in to your Google account or download apps from the Play Store. Fortunately, there is a solution to this problem (even if it is quite cumbersome).

1. Plug one end of a USB cable into your PC and the other end into the USB Type-C port on your Raspberry Pi, and wait for it to turn on.

2. Open it Settings application on your Raspberry Pi and activate the Developer options by pressing the button seven times Build number in the About the tablet on your mind.

The build number highlighted in LineageOS settings

3. Open Developer Options and enable USB debugging And Rooted Debugging.

Debugging options highlighted in LineageOS

4. Switch to your PC and configure ADB by following this guide.

5. Open Terminal/PowerShell on the ADB and type the following command:

.\adb root

The .\adb root command executed in the Windows Terminal application

Make sure you Accept the connection request inside your Raspberry Pi.

6. Next, access the Unix shell by running this command:

.\adb shell

The .\adb shell command executed in the Windows Terminal application

7. Paste this command into the Unix shell:

sqlite3 /data/data/com.google.android.gsf/databases/gservices.db

The sqlite3 command in the Unix shell

8. In the SQLite interface, type the final command:

select * from main where name = "android_id";

The ADB command used to find out the Android ID

9. Here the hexadecimal string is your Android ID and you will need to certify your device by pasting it on this link.

The hex string (Android_ID) of a Raspberry Pi running LineageOS

ten. Restart your Raspberry Pi once you click the Register button on the previous link.

Once the Raspberry Pi restarts, Google Play Services will stop showing the error message and you will be able to sign in to your Google account.

(Optional) Installing Magisk

Now that we have Google Play installed, setting up Magisk is the final step to turn your Raspberry Pi into a full-fledged Android device.

1. Download version 25.2 of the Magisk apk file with its LineageOS compatible zip file.

2. Enter recovery mode like you did when setting up Google Play.

3. (Optional) While you are in the recovery environment, I recommend flashing the Resize module as it will allow you to use all the unallocated space on your microSD card.

4. Flash the Magisk zip file into the TWRP interface before rebooting into Android 14.

5. Using the File managerlocate it Magisk.apk file and install it.

The procedure to install Magisk

6. When launching Magisk, the application will ask you to complete the installation by restarting your Raspberry Pi.

The OK button highlighted in the Magisk app

7. Simply press the ALL RIGHT to complete the Magisk setup procedure.

Run Android on the Raspberry Pi

Raspberry Pi 5 running LineageOS

With this, your Raspberry Pi flavored Android tablet is ready to use. While even the most expensive 8GB variant of the Raspberry Pi 5 struggles to run Steam games, Android games tend to run well on the device. As such, you can even use the Raspberry Pi as an Android emulator if you get tired of running retro console games on the SBC.


How to emulate games on your Raspberry Pi

Here’s everything you need to know to emulate older gaming systems on the Raspberry Pi.



Related posts