Easy Ways To Install Android Studio on Ubuntu 20.04

Posted on

Easy Ways To Install Android Studio on Ubuntu 20.04

Easy Ways To Install Android Studio on Ubuntu 20.04

In this guide, we intend to teach you How To Install Android Studio on Ubuntu 20.04. Android Studio is the integrated development environment for Google’s Android platform. Versions of Android Studio are compatible with some Apple, Windows, and Linux operating systems. With support for Google Cloud Platform and Google app integration, Android Studio offers developers a well-stocked toolkit for creating Android apps or other projects and has been an integral part of Android development since 2013.

You can now proceed to the guide steps below on the Orcacore website to start your Android Studio installation on Ubuntu 20.04.

To complete this guide, you must log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide to the Initial Server Setup with Ubuntu 20.04.

This article will show you how to install Android Studio on your Ubuntu server in 2 methods:

Method 1. Set up Android Studio from Official Repository

You can install Android Studio by adding the official Android repository to your server. First, you need to make sure that Java is installed on your server. To do this, run the command below:

java –version

If Java is not installed on your system, you need to install it.

Installing OpenJDK

At this point, you can install Java JDK-11 on your system with the following command:

sudo apt install default-jre -y

Verify your Java installation by checking its version:

java –version
**Output**
openjdk 11.0.16 2022-07-19
OpenJDK Runtime Environment (build 11.0.16+8-post-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Ubuntu-0ubuntu120.04, mixed mode, sharing)

Add Android Studio Repository

At this point, you can use the command below to add the Android Studio repository to your Ubuntu 20.04:

sudo add-apt-repository ppa:maarten-fonville/android-studio

When adding the repository, you will be prompted to press Enter to continue.

Installing Android Studio

Now that everything is done, update your local package index:

sudo apt update

Then, use the command below to install Android Studio:

sudo apt install android-studio -y

Method 2. Set up Android Studio via Snap

You can also install Android Studio using Snap on your Ubuntu 20.04. The Snap packages are available and installed on Ubuntu 20.04 by default. If it is not available, you can install it with the command below:

sudo apt install snapd -y

Once your installation is completed, restart your system to ensure Snap’s paths are updated correctly:

sudo reboot

Now, use the following Snap command to install Android Studio:

sudo snap install android-studio --classic

When your installation is completed, you will get the following output:

**Output**
android-studio 2021.2.1.15 from Snapcrafters installed

How To Run Android Studio on Ubuntu 20.04?

At this point, launch this tool on your system to verify that the installation has worked. Click on ‘Activities’ and then type ‘Android’ in the application launcher bar. You will see the Android Studio icon appear under the search bar.

Launch android studio on Ubuntu 20.04

Then, click on the Android Studio icon, and the following screen will appear on your desktop.

You should click on Do Not Import Settings and click Ok.

Do not import android studio settings

It will search for available SDK components.

Next, the Android Studio Setup wizard will appear on your Ubuntu 20.04. At the welcome screen, just click Next.

Then, you need to choose the Android Studio Installation type. You need to choose the Standard option and click Next.

Android studio installation type

Now, you need to select the UI theme. Choose Light or Darcula and click Next.

At this point, you will be asked to verify or review the installation settings. Click ‘Next’ if you are okay with the installation settings.

You are now at the end of the setup process, so you will click the ‘Finish’ option on the Emulator Settings screen.

This will download all the necessary Android components on your Ubuntu 20.04.

When your download is completed, click Finish.

The following screen will display on your system from which you can use Android Studio on your system. Choose the option Start a new Android Studio project to create a new application.

Start a new android studio project on Ubuntu 20.04

That’s it, you are done. Your Android Studio has been installed and configured on Ubuntu 20.04.

Conclusion

At this point, you learn to Install Android Studio on Ubuntu 20.04 through both the Official repository and the Snap Store. After your setup is completed, Android Studio gives you a complete and reliable environment for building Android apps.

Hope you enjoy it. Please subscribe to us on Facebook and Twitter.

You may also like to read the following articles:

Install KVM on Ubuntu 20.04

Set up 7-Zip on Ubuntu 20.04

Install and Use Telnet on Ubuntu 20.04

Alternative Methods to Install Android Studio on Ubuntu 20.04

While the official repository and Snap Store methods are convenient, alternative approaches exist for installing Android Studio on Ubuntu 20.04. These methods often provide greater control over the installation process and can be useful in specific scenarios. Here are two such alternatives:

Method 3: Manual Installation from Archive

This method involves downloading the Android Studio archive directly from the official Android Developer website and manually extracting and configuring it.

Explanation:

This approach bypasses package managers (apt, snap) and allows you to install Android Studio in a custom location. This can be useful if you have specific directory requirements or want to manage multiple Android Studio versions independently. The process involves downloading the appropriate archive, extracting its contents to a desired directory, and creating a desktop entry for easy access. You’ll also need to ensure that the necessary environment variables are set.

Steps:

  1. Download the Android Studio Archive: Visit the Android Studio Archive and download the Linux version (.tar.gz) for your architecture (usually x86_64).
  2. Extract the Archive: Open a terminal and navigate to the directory where you downloaded the archive. Extract the archive using the following command (replace <version> with the actual version number):

    tar -xzf android-studio-<version>-linux.tar.gz
  3. Move the Extracted Directory: Move the extracted android-studio directory to your desired installation location. For example, to install it in /opt:

    sudo mv android-studio /opt/
  4. Run Android Studio: Navigate to the bin directory within the Android Studio installation directory:

    cd /opt/android-studio/bin

    Run the studio.sh script to start Android Studio:

    ./studio.sh
  5. Complete the Setup Wizard: Follow the same steps outlined in the original article to complete the Android Studio setup wizard (import settings, choose installation type, theme, etc.).
  6. Create a Desktop Entry (Optional): To create a desktop entry for easy access, create a .desktop file in ~/.local/share/applications/. For example, create a file named android-studio.desktop with the following content (adjust paths as necessary):

    [Desktop Entry]
    Name=Android Studio
    Comment=Android IDE
    Exec=/opt/android-studio/bin/studio.sh
    Icon=/opt/android-studio/bin/studio.png
    Terminal=false
    Type=Application
    Categories=Development;IDE;

    Make the file executable:

    chmod +x ~/.local/share/applications/android-studio.desktop

Method 4: Using SDKMAN! (Software Development Kit Manager)

SDKMAN! is a tool for managing multiple software development kits on your system, including different versions of the Java Development Kit (JDK), which is essential for Android Studio.

Explanation:

This method provides a way to manage JDK versions easily. Android Studio requires a specific version of the JDK, and SDKMAN! simplifies the process of installing and switching between different JDKs. While it doesn’t directly install Android Studio, it sets up the environment perfectly for a manual or apt installation.

Steps:

  1. Install SDKMAN!: Open a terminal and run the following command to install SDKMAN!:

    curl -s "https://get.sdkman.io" | bash

    Follow the on-screen instructions to complete the installation. You’ll likely need to open a new terminal window or source the SDKMAN! initialization script (source "$HOME/.sdkman/bin/sdkman-init.sh").

  2. Install a Compatible JDK: Use SDKMAN! to install a compatible JDK version (e.g., JDK 11). First, list available JDKs:

    sdk list java

    Then, install a suitable JDK (replace <identifier> with the correct identifier from the list):

    sdk install java <identifier>

    For example, if the identifier for a suitable OpenJDK 11 version is 11.0.16-open, you would use:

    sdk install java 11.0.16-open
  3. Set the Default JDK (Optional): You can set the installed JDK as the default:

    sdk default java <identifier>
  4. Install Android Studio (using apt or manual method): After setting up the JDK with SDKMAN!, you can proceed with installing Android Studio using either the apt method (Method 1 in the original article) or the manual installation method (Method 3 described above). The environment will now be properly configured with the correct JDK.

These alternative methods offer flexibility and control over the installation process. Choose the method that best suits your needs and technical preferences. Regardless of the chosen method, ensure that you have a stable internet connection and follow the instructions carefully. With a successful installation, you’ll be well on your way to developing Android applications on your Ubuntu 20.04 system.

Leave a Reply

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