Raspberry pi 4 android studio

How to Install Android 9 on Raspberry Pi 4

Raspberry Pi gives you the freedom to install a huge range of operating systems, including some niche operating systems! While systems that were designed for Raspberry Pi tend to provide a more reliable user experience, there may be a time when you need a very specific feature set, like accessing Android apps.

In this article you’ll learn how to bring touchscreen support by installing Android 9.0 on Raspberry Pi 4. While the user experience can sometimes feel awkward and laggy, you’ll have multi-touch and touchscreen support, access to a huge variety of Android apps, and the bragging rights that you managed to get Android up and running on Raspberry Pi!

Also read: How to Create a Plex Server on Raspberry Pi 4

What you’ll need

To complete this tutorial, you’ll need:

  • A Raspberry Pi 4
  • An SD card
  • A laptop or computer where you’ll download the Android 9.0 system image
  • A power cable that’s compatible with your Raspberry Pi
  • A micro HDMI cable
  • An external monitor, or, if you want that authentic Android experience, a screen that has touchscreen support
  • An external keyboard and a way to attach this keyboard to your Raspberry Pi
  • A mouse or the trackpad on your external keyboard
  • Optionally, an ethernet cable

Once you’ve assembled your tools, you’re ready to get Android 9.0 running on Raspberry Pi!

Downloading LineageOS 16.0

We’re using a build of LineageOS 16.0 as the base Android 9.0 image. Do note that this build is unofficial and unsupported by the LineageOS team, and it typically isn’t suitable for performing intensive tasks, such as playing games or streaming high-resolution media.

We’re flashing this system image to our SD card using the free Etcher application, so if you don’t already have this set up on your computer or laptop, then head over to the balenaEtcher website and download the latest version.

  • Head over to the KonstaKANG website and download LineageOS 16.0.
  • Insert the SD card into your laptop or computer.
  • Launch the Etcher application.
  • In Etcher, click “Select image” and then choose the LineageOS file you just downloaded.
  • Click “Select target” and choose your target boot medium, which in this instance is the SD card.

Etcher will now flash the system image to the SD card.

Running Android on Raspberry Pi

You’re now ready to get your first taste of Android running on the Raspberry Pi!

  1. Remove the SD card from the laptop or computer and insert it into the Raspberry Pi.
  2. Attach the monitor to the Raspberry Pi using the micro HDMI cable.
  3. Attach the keyboard to the Raspberry Pi device.
  4. Attach an ethernet cable to the Raspberry Pi.
  5. Plug the Raspberry Pi into a power source. The device should now boot automatically.
  6. After a few minutes you’ll see the “Lineage” welcome screen. Click “Next.”

  1. You’ll now be prompted to complete the usual setup, such as choosing a language, setting the time and date, and connecting to a Wi-Fi network.
  2. Once you’ve entered all this information, click “Start.”

You’ll now be taken to the main Android screen.

Also read: How to Install Android TV in Raspberry Pi 3

Don’t forget about Google Play!

Android should now be up and running, but LineageOS doesn’t come with Google Play installed. To get Google Play, download and install GApps, which includes Google Play and all the services required to power this application. The Device ID APK is needed as well, which will be used to generate a code that identifies the device and allows us to connect to Google Play.

  • Launch the web browser that comes pre-installed on Android and head to the GApps website.
  • Select “ARM,” “Android 9” and “Pico,” and then click the “Download” icon.

Moving the GApps file

To make the next steps easier, drag the GApps file to the root of your storage:

  1. Drag upwards from the bottom of the screen to open the app drawer.
Читайте также:  Дубль гис с навигатором для андроид

  1. Find the “Files” application and give it a click.
  2. Select “Downloads.”
  3. Find the “GApps” file that was just downloaded and drag it towards the menu on the left. Release “GApps” over “Raspberry Pi 4.”

This file will now be easier to find when we boot into Recovery mode.

Unlock Android’s hidden Developer Options

Developer Options need to be enabled, which will give you access to the Terminal:

  1. Drag upwards from the bottom of the screen to open the application drawer.
  2. Select the “Settings” application.
  3. Open “About tablet.”

  1. Find the “Build Number” section and click it repeatedly until you see a “You have now enabled developer settings” pop-up.

  1. Navigate back to the main “Settings” screen, but this time navigate to “System -> Advanced -> Developer Options.”
  2. Tap “Root access.” In the subsequent pop-up, ensure “Apps and ADB” is selected.

  1. When prompted to allow root access, click “OK.”
  2. Next, scroll to the bottom of the “Developer Options” screen, find “Local Terminal” and drag its accompanying slider to the “On” position.

You can now exit the “Settings” application.

Raspberry Pi needs to be rebooted in order to gain access to the Terminal, so press the F5 key on the keyboard, which will open a “Power” menu where you can select “Restart.”

Boot into Android’s Recovery Mode

To boot into Recovery Mode:

1. Open the app drawer by dragging upwards from the bottom of the screen.

2. Select “Terminal.”

3. Type the following command into the Terminal window:

4. Press the “Enter” key on your keyboard. When prompted, select “Remember my choice” followed by “Allow.”

5. Type the following command into the Terminal:

Press the Enter key and run the following command:

Android will now reboot into Recovery Mode.

Install GApps and wipe the Dalvik cache

To install GApps:

1. In Recovery mode, find the “Swipe to allow modifications” slider and drag it to the “On” position.

2. Select “Install” and find the GApps package you downloaded earlier.

3. Give GApps a tap, then drag the “Swipe to confirm Flash” slider. GApps will now be installed.

4. Wipe the Dalvik cache by dragging the “Swipe to wipe” slider.

5. When you see the “Dalvik wipe complete” screen, click the “Back” button.

6. In the upper-left corner, select the “Team Win Recovery Project” icon, which will take you back to the main menu.

8. Drag the “Swipe to Factory Reset” slider.

9. When prompted, click “Back.” In the upper-left corner, select the “Team Win Recovery” button which will once again take you back to the main menu.

11. Make sure “Boot,” “System” and “Data” are all selected, then return to the main screen by clicking the “Team Win Recovery Project” icon.

12. Click “Advanced -> Terminal.”

13. To reboot the system from Terminal, type:

Press the Enter key on your keyboard.

14. Type the following command into the Terminal:

Press Enter. The system will now reboot.

Once Android has booted, you may need to perform some extra configuration: for example, agreeing to the Google Terms and Conditions and setting up a protective PIN. Once you’ve completed this setup, there should be a new addition to your homescreen: Google Play is now installed on your device!

However, there’s a catch: if you try to launch the Google Play application, then you’ll encounter a warning that your device isn’t Play Protect-certified. The final task is to generate a code using the Device ID APK, then using this code to authenticate the device.

Get Play Protected: Registering with Google

To generate the Device ID code:

  • Open the app drawer by dragging from the bottom of the screen, then selecting “Files.”
  • Navigate to the “Downloads” folder.
  • Find the Device ID APK that you downloaded earlier and double-click to launch. When prompted, select “Install.”
  • Open the app drawer and select the newly-installed Device ID application.
  • Once the app has launched, click “Google Service Framework.” A code will appear in a pop-up. Click “Copy.”
  • Towards the top of the screen, you should see a “Device is not Play Protect certified” warning. Click this to launch a popup.
  • In the pop-up, scroll to the “Custom ROM users” section and click the accompanying link. This will launch Android’s default web browser.
  • When prompted, log into your Gmail account.
  • Once you’re logged in, paste the code from the Device ID APK and paste it into the “Register” field.
  • Select “Register.” Google will now register this device as a custom ROM and allow you to access Google Play.
Читайте также:  Mini one android phone

Your changes only become active following a reboot, so use the F5 key to reboot the system.

When your Raspberry Pi has performed its reboot, launch the Google Play app, sign in with your Gmail account, and you’re ready to start downloading Android apps to the Raspberry Pi 4!

If you receive an error message when trying to access Google Play for the first time, then try waiting for around 15 minutes, as there can sometimes be a delay before Google successfully registers your ID.

Although Android 9.0 wasn’t designed for Raspberry Pi, it offers a unique combination of touchscreen support and access to an entire ecosystem of Android apps. Other than that, there are also many other ways to put the Raspberry Pi 4 to good use.

Never Miss Out

Receive updates of our latest tutorials.

Jessica Thornsby is a technical writer based in Derbyshire, UK. When she isn’t obsessing over all things tech, she enjoys researching her family tree, and spending far too much time with her house rabbits.

Источник

Как установить Android 11 на Raspberry Pi 4

Raspberry Pi был незаменимым помощником для технических специалистов и энтузиастов. Он предлагает множество вариантов обновления и во многих случаях поставляется со своим собственным набором микросхем и оперативной памятью, что позволяет использовать несколько вариантов использования. Вы можете использовать его для управления камерами видеонаблюдения, создания удаленной рабочей станции, создания медиацентра и многого другого.

Многие люди уже довольно давно пытаются запустить Android на Pi 4, и мы увидели несколько крупных релизов еще в 2019 году. Все они были основаны на Android 10, но, к счастью, только что была выпущена новая сборка, которая позволит вам чтобы наслаждаться Android 11 на Raspberry Pi 4. Давайте быстро взглянем на него.

Что такое ОмниРОМ?

OmniROM — это новая сборка Raspberry Pi на базе Android 11. Она поставляется в флэш-архиве .zip и может быть получена из Разработчики XDA. OmniROM уже довольно давно является заметным именем в сообществе XDA. За последние несколько месяцев они выпустили несколько сборок на базе Android 11 для нескольких телефонов. Этот опыт, вероятно, сделал их достаточно смелыми, чтобы создать сборку для Pi 4.

OmniROM для Pi 4 поставляется в двух вариантах: один в комплекте с приложениями microG, а другой позволяет устанавливать стандартные Gapps. Сборка microG больше ориентирована на конфиденциальность, поскольку она не полагается на сервисы Google Play или Play Store.

Еженедельные сборки предназначены для установки с Google Apps, когда вы записываете ПЗУ на SD-карту. Хотя сборка из коробки довольно стабильна, это пока только первая. Может быть несколько ошибок, поэтому не рекомендуется использовать его в качестве повседневного драйвера.

Кроме того, хотя новый OmniROM поддерживает установку на USB-носители и жесткие диски, вам необходимо будет создать свои собственные разделы, а затем отформатировать их на основе файловых систем, поддерживаемых Pi 4. Поэтому мы рассмотрим только процедуру для SD-карты, которые автоматически распознаются как загрузочный диск при подключении к вашему Pi 4.

Связанный: Как установить официальное обновление Android 11

Что следует иметь в виду

Это первая сборка OmniROM на базе Android 11 для Pi 4, и она не рекомендуется в качестве ежедневного драйвера для большинства пользователей. Кроме того, в текущей сборке отсутствует поддержка аппаратного кодирования и декодирования, что не позволит вам транслировать HD-контент в большинстве популярных приложений. Однако, если вы все еще хотите транслировать контент, вы можете попробовать Firefox для Android, который на данный момент работает довольно хорошо в качестве временного решения.

Кроме того, вам также следует просмотреть страницу readme, опубликованную разработчиком по адресу эта ссылка. Это поможет вам выявить дополнительные недостатки сборки, которые помогут вам определить, следует ли вам переходить на нее или нет.

Как установить Android 11 на Raspberry Pi 4

Чтобы запустить Android 11 на вашем Pi 4, вам необходимо убедиться, что вы используете последнюю версию прошивки для своего устройства. Если вы недавно обновили прошивку, вы можете пропустить это руководство и сразу перейти к процедуре перепрошивки. Но если вы давно не обновляли свой Pi 4, давайте кратко рассмотрим процедуру.

Как сначала обновить прошивку Raspberry Pi 4

Перед установкой OmniROM нам необходимо сначала обновить прошивку.

Необходимый

  • Ваш Pi 4 работает под управлением Raspberry Pi OS
  • Ваш Pi 4 подключен к Интернету

Включите Raspberry Pi 4 и запустите окно терминала с панели задач.

Читайте также:  Может ли эпл вотч работать с андроидом

После открытия окна терминала введите следующую команду.

Примечание: Вам нужен только текст в кавычках.

Нажмите Enter, чтобы запустить команду.

Ваш Pi 4 теперь проверит установленную прошивку вместе с последней прошивкой, доступной на серверах Raspberry. Затем он отобразит всю информацию о вашем устройстве. В последних двух строках будет отображаться текущая прошивка и последняя доступная прошивка. Если эти два числа совпадают, значит, у вас установлена ​​последняя версия прошивки.

Но если они не совпадают, вам нужно будет обновить прошивку до последней версии. Введите следующую команду, чтобы обновить прошивку до последней версии.

Теперь ваш Pi 4 будет связываться с серверами и получать все необходимые файлы, необходимые для установки. После завершения этого процесса используйте команду ниже, чтобы установить последнюю версию прошивки.

Ваш Pi 4 начнет обновляться до последней доступной прошивки. Убедитесь, что вы не выключаете свое устройство во время этой процедуры, так как это может привести к повреждению установки и вынудить вас выполнить восстановление на вашем Pi 4.

После завершения процесса на вашем Pi 4 должна быть установлена ​​последняя версия ОС Pi. Теперь мы можем двигаться дальше и установить OmniROM на базе Android 11 на ваше устройство.

Как установить OmniROM для Android 11

Перед тем, как начать установку OmniROM, вам нужно будет загрузить несколько файлов. В основном сборка OmniROM для вашего Pi 4, Gapps, если они вам нужны, и инструмент для перепрошивки. Вы можете скачать их все по ссылкам ниже.

Примечание: Если вы не хотите использовать приложения Google в OmniROM, убедитесь, что вы загрузили версию microG, как показано ниже.

Если вы хотите использовать Gapps с OmniROM, убедитесь, что вы загрузили последнюю еженедельную сборку OmniROM. Кроме того, при загрузке Gapps вы получите множество вариантов. Мы рекомендуем пакет приложений nano для вашего Pi 4, но вы можете получить дополнительную информацию о каждой сборке на эта ссылка. Для этой процедуры мы будем использовать сборку MicroG для OmniROM. Сборка microG поставляется с предустановленными сервисами Aurora и магазином Aurora.

Необходимый

После того, как вы загрузили все в свое хранилище, запустите инструмент для перепрошивки Etcher. Он поставляется как переносимый исполняемый файл для систем Windows и как установщик для macOS и Linux. Если вы используете Windows, просто дважды щелкните файл .exe, чтобы запустить программу. Если вы используете macOS или Linux, следуйте инструкциям по установке, а затем запустите приложение после его установки.

Теперь нажмите «Прошить из файла».

Откроется окно, показывающее локальное хранилище на вашем устройстве. Найдите и выберите сборку OmniROM, которую вы только что скачали, и нажмите «Открыть», когда закончите.

Теперь подключите SD-карту, которую вы планируете использовать с Pi 4. Подождите, пока карта распознается. Как только он будет распознан, нажмите «Изменить» под значком диска посередине.

Установите флажок для вашей SD-карты Pi 4.

Нажмите «Выбрать» внизу.

Наконец, нажмите «Flash».

Теперь сборка OmniROM будет записана на вашу SD-карту. Этот процесс может занять некоторое время в зависимости от скорости передачи данных, доступной для вашей SD-карты. После завершения процесса вы сможете использовать OmniROM на своем Pi 4.

Ваш компьютер может отображать несколько сообщений об ошибках, но они распространены, поскольку карта теперь отформатирована для распознавания вашим Pi 4, поэтому Windows столкнется с ошибками при чтении ее содержимого.

Примечание: Если вы скачали еженедельную сборку, сейчас самое время прошить файл .zip на SD-карту. Используйте Etcher таким же образом, как указано выше, но вместо выбора сборки OmniROM в начале просто выберите пакет Gapps, который вы загрузили из OpenGapps, и запишите его на SD-карту.

После прошивки подключите SD-карту к Pi 4 и включите ее.

И это все! Теперь у вас должен быть Android 11 на вашем Pi 4. Первая загрузка может занять некоторое время, поэтому будьте терпеливы и не выключайте устройство на полпути. После загрузки вы автоматически попадете на рабочий стол своего устройства. Теперь вы можете использовать новый Pi 4 под управлением Android 11, как хотите.

Примечание: Текущая сборка OmniROM не поддерживает аппаратное кодирование или декодирование видео, что означает, что вы не сможете транслировать высококачественный контент на свой Pi 4. Однако Firefox как браузер, похоже, работает достаточно хорошо при потоковой передаче контента 720p, который требует аппаратное кодирование. Таким образом, вы можете попробовать Firefox в качестве альтернативы, пока не будет выпущено обновление для OmniROM с поддержкой аппаратного кодирования и декодирования.

Мы надеемся, что это руководство помогло вам легко установить Android 11 на Raspberry Pi 4. Если у вас есть к нам какие-либо вопросы или проблемы, не стесняйтесь обращаться к нам, используя раздел комментариев ниже.

Источник

Оцените статью