How to Install Android Studio on Ubuntu 20.04

Android Studio is the official Integrated Development Environment (IDE) for Android app development, based on IntelliJ IDEA .

To support application development within the Android operating system, Android Studio uses a Gradle-based build system, emulator, code templates, and Github integration.

Every project in Android Studio has one or more modalities with source code and resource files. These modalities include Android app modules, Library modules, and Google App Engine modules.

Android Studio is available for download on Windows, macOS and Linux based operating systems.

It’s a replacement for the Eclipse Android Development Tools (E-ADT) as the primary IDE for native Android application development.

Key Features of Android Studio:

On top of IntelliJ’s powerful code editor and developer tools, Android Studio offers even more features that enhance your productivity when building Android apps, such as:

  • A flexible Gradle-based build system
  • A fast and feature-rich emulator
  • A unified environment where you can develop for all Android devices
  • Apply Changes to push code and resource changes to your running app without restarting your app
  • Code templates and GitHub integration to help you build common app features and import sample code
  • Extensive testing tools and frameworks
  • Lint tools to catch performance, usability, version compatibility, and other problems
  • C++ and NDK support
  • Built-in support for Google Cloud Platform, making it easy to integrate Google Cloud Messaging and App Engine

Advantages and Disadvantages

Every application has some advantages and disadvantages. Here we have listed our observations on Android Studio.

Pros:

  • Support for developing in either the emulator or a device means I can quickly diagnose platform specific issues.
  • The support for Kotlin and Java is stellar, with projects easily containing both types of code with ease.
  • Hot reload support means that I can quickly test changes without waiting for a length build and optimization process.
  • Excellent cross platform support means I can develop on macOS, Windows, or Linux without losing functionality between platforms

Cons:

  • Slow performance on older PCs.
  • Project opening involves a long indexing and warm up process, meaning that a quick peek at an old project can result in a wait of a few minutes.
  • Initial build times can be very long, although these have been slowly improving in recent versions of Android Studio.

Basic system requirements for Android Studio:

These are the minimum system requirements for installing Android Studio on a Linux System.

  • Operating System: GNOME or KDE desktop
  • RAM: 4 GB RAM minimum, 8 GB RAM (Recommended)
  • Storage: 2 GB Minimum, 4 GB (Recommended)
  • JDK version: Java Development Kit 8
  • Minimum screen resolution: 1280 x 800

This article explains two methods of installing Android Studio on Ubuntu 20.04.

Installing Java OpenJDK

Like I mentioned in minimum system requirements, we have to install Java OpenJDK first.

Note: Android Studio requires OpenJDK version 8 or above to be installed to your system.

Type the following command to check whether Java is already installed on your system.

$ java -version

You can skip this step if Java is already installed, and if Java is not installed then follow the steps below.

In this tutorial I will install OpenJDK 11 and the installation is pretty straightforward.

First update the package index and then Install the OpenJDK 11 package by typing the following command.

$ sudo apt update && sudo apt install openjdk-11-jdk

Method 1: Installing Android Studio from official repositories

In this method, we will install Android Studio from the official repositories.

The benefit of installing Android Studio using this method is that, it will automatically update when a new updated version is released.

Step #1

Type the following command to add the official Android Studio repository to the source list of your ubuntu system.

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

During this process you will be prompted to press ENTER to continue.

Step #2

After adding the repository, update the package index by running the following command.

$ sudo apt update && sudo apt upgrade

Step #3

Now execute the following command to install the Android Studio(Stable Version) package.

$ sudo apt install android-studio

You can run the following command to install the preview version of Android Studio.

$ sudo apt-get install android-studio-preview

Method 2: Installing Android Studio as a Snap Package

The Android Studio snap package is distributed and maintained by the Google.

A snap package is a type of universal Linux package that you can enjoy irrespective of the distro. Its an self-contained software packages that include the binary all dependencies needed to run the application.

All you need is the snap service pre-configured, In the case of Ubuntu 20.04, it comes with snap pre-installed.

If snapd package is not already installed then you can install it by running following command.

$ sudo apt install snapd

Note: Snap packages can be installed from either the command-line or via the Ubuntu Software application.

This is actually the Snap version of the Android Studio. It can be used on any Linux distribution that has Snap support.

Open your terminal (Ctrl+Alt+T) and type the following command to install the Android Studio package.

$ sudo snap install android-studio --classic

Once the installation is complete, you will see the following output.

Output:
android-studio 3.3.1.0 from Snapcrafters installed

That’s It. Now you can open the Android Studio application with the help of Activities search bar.

Note: Whenever a new version is released, the snap package will be automatically updated in the background.

If you are not comfortable with the command line, open Ubuntu Software, search for “Android” and install the application.

Install through Ubuntu Software Center

For some reason, If you want to uninstall Android Studio application, type the following command.

$ sudo snap remove android-studio

Starting Android Studio

In the Activities search bar type “Android Studio” and click on the icon to launch the application OR you can start Android Studio either by typing android-studio in your terminal.

Activity Search Bar

When you start Android Studio for the first time, a window like the following will appear asking you to import Android Studio settings from a previous installation.

Once you click on the OK button, the Setup Wizard window will appear.

Click on the Next button to start the initial configuration and post-installation steps.

Next, you will be prompted to choose the type of setup you want for Android studio. Most likely you will want to select the “Standard” option.

On the next step you can select the UI theme and the Setup Wizard will download and install the required SDK components.

The process may take some time depending on your connection speed. Once the Android Studio IDE is loaded, you’ll be presented with the Welcome page.

Image Credit: itzgeek.com

Conclusion

I hope that now you have a good understanding of How to Install Android Studio on Ubuntu 20.04 LTS Focal Fossa.

If anyone does have any questions about what we covered in this guide then feel free to ask in the comment section below and I will do my best to answer those.

Leave a Comment