How to install Android studio in Ubuntu

To install Android studio in Ubuntu 16.04

Android Studio is the free IDE (integrated development environment) for Android platform development. Installation of Android studio is explained in this tutorial.


To install Java

Before installing android studio, add the java repository to apt source, using “ add-apt” command.

root@linuxhelp:~# add-apt-repository -y ppa:webupd8team/java
gpg: keyring `/tmp/tmps5bnjwws/secring.gpg'  created
gpg: keyring `/tmp/tmps5bnjwws/pubring.gpg'  created
gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmps5bnjwws/trustdb.gpg: trustdb created
gpg: key EEA14886: public key " Launchpad VLC"  imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK

Update repository by running the following command.

root@linuxhelp:~# apt-get update
Hit:1 http://in.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease             
Hit:3 http://security.ubuntu.com/ubuntu xenial-security InRelease              
Hit:4 http://ppa.launchpad.net/enlightenment-git/ppa/ubuntu xenial InRelease   
Hit:5 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease           
Hit:6 http://ppa.launchpad.net/gns3/ppa/ubuntu xenial InRelease          
Hit:7 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial InRelease
Reading package lists... Done

Run the following command to install java.

root@linuxhelp:~# apt-get install oracle-java7-installer oracle-java7-set-default
Reading package lists... Done
Building dependency tree       
Reading state information... Done
.
.


.
.
Oracle JDK 7 installed
update-alternatives: using /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libnpjp2.so to provide /usr/lib/mozilla/plugins/libjavaplugin.so (mozilla-javaplugin.so) in auto mode
Oracle JRE 7 browser plugin installed
Setting up gsfonts-x11 (0.24) ...
Setting up oracle-java7-set-default (7u80+7u60arm-0~webupd8~1) ...

Now the java installation is successfully completed.

Install the following dependencies.

root@linuxhelp:~# apt-get install lib32stdc++6 lib32ncurses5-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  gcc-5-multilib gcc-multilib lib32asan2 lib32atomic1 lib32cilkrts5 lib32gcc-5-dev
  lib32gcc1 lib32gomp1 lib32itm1 lib32mpx0 lib32ncurses5 lib32quadmath0 lib32tinfo-dev
  lib32tinfo5 lib32ubsan0 libc6-dev-i386 libc6-dev-x32 libc6-i386 libc6-x32
.
.
.
.
Setting up libtinfo-dev:amd64 (6.0+20160213-1ubuntu1) ...
Setting up libncurses5-dev:amd64 (6.0+20160213-1ubuntu1) ...
Setting up lib32ncurses5-dev (6.0+20160213-1ubuntu1) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...

Add android repo file to “ apt” source list.

root@linuxhelp:~# add-apt-repository ppa:paolorotolo/android-studio
 Automatic builds for Android Studio by Google packaged for Ubuntu.
 More info: https://launchpad.net/~paolorotolo/+archive/ubuntu/android-studio
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmp2jx0f0cd/secring.gpg'  created
gpg: keyring `/tmp/tmp2jx0f0cd/pubring.gpg'  created
gpg: requesting key 7B9B74AA from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp2jx0f0cd/trustdb.gpg: trustdb created
gpg: key 7B9B74AA: public key " Launchpad PPA for Paolo Rotolo"  imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK

Next update apt source list.

root@linuxhelp:~# apt-get update
Hit:1 http://in.archive.ubuntu.com/ubuntu xenial InRelease          
Hit:2 http://security.ubuntu.com/ubuntu xenial-security InRelease   
Hit:3 http://ppa.launchpad.net/enlightenment-git/ppa/ubuntu xenial InRelease
Hit:4 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease       
Hit:5 http://ppa.launchpad.net/gns3/ppa/ubuntu xenial InRelease          
Hit:6 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease     
Get:7 http://ppa.launchpad.net/paolorotolo/android-studio/ubuntu xenial InRelease [17.6 kB]
Hit:8 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial InRelease
Get:9 http://ppa.launchpad.net/paolorotolo/android-studio/ubuntu xenial/main amd64 Packages [464 B]
Get:10 http://ppa.launchpad.net/paolorotolo/android-studio/ubuntu xenial/main i386 Packages [464 B]
Get:11 http://ppa.launchpad.net/paolorotolo/android-studio/ubuntu xenial/main Translation-en [200 B]
Fetched 18.7 kB in 5s (3,640 B/s)
Reading package lists... Done

To install Android studio

Utilise the following command to install Android studio.

root@linuxhelp:~# apt-get install android-studio
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  android-studio
.
.
.
.
  inflating: android-studio/lib/coverage-util.jar  
  inflating: android-studio/lib/xbean.jar  
  inflating: android-studio/lib/junit.jar  
  inflating: android-studio/lib/jps-model.jar  
  inflating: android-studio/lib/icons.jar  
  inflating: android-studio/lib/httpclient-4.4.1.jar  
  inflating: android-studio/lib/winp-1.23.jar  
  inflating: android-studio/LICENSE.txt  

Now we have successfully installed android studio.

Search Android studio app in the Unity dash board.

" Complete installation" message box appears, Click “ OK”


Open “ Android studio setup wizard” and click “ next” .

Choose the type of installation and click “ next” .

Verify the settings and click “ next” to proceed further.

Click “ finish” to run android emulator.

After the components is downloaded, click “ finish” .

Welcome page appears. Select “ start a new android studio project” .

In Configure your new project, set project name and domain. Then click “ next” .

Select the form factor for android device and click “ next”

Next select “ activity” and click “ next” .

Enter the “ activity name” , “ layout name” and click “ finish” .

Now the project will be loaded.

FAQ
Q
Can two instant apps run in parallel?
A
Yes, instant apps can run in parallel and users can switch between them. Only the instant app in the foreground has an icon in the notification shade.
Q
Is multidex supported for instant apps?
A
Multidex is supported for instant apps. If you have an app that satisfies the maximum size requirement but contains more methods than the dex limit of 65,536 methods, you can still enable multidex and publish it as an instant app.
Q
What is Android studio?
A
*Android Studio is the free IDE (integrated development environment) for Android platform development.
Q
What devices are supported for Google Play Instant?
A
Google Play Instant is supported on the majority of devices running Android 5.0 (API level 21) and higher.
Q
Which SDK version should an instant app target?
A
our instant app's manifest must set targetSdkVersion to 26 or higher.