Android SDK setup
-Method 1 :
Update Ubuntu
You should always update your system first before you do anything else. Run the following commands:
sudo apt-get update && apt-get upgrade
And install the required package if you don’t have it already installed:
sudo apt-get install software-properties-common
Install Java
using ubuntu terminal :
sudo dpkg --add-architecture i386 sudo apt-get install libbz2-1.0:i386 sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 sudo apt-get install openjdk-8-jdk openjdk-8-jre
```
Add JAVA_HOME to path via ~/.bashrc
using ubuntu terminal :
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
Check what Java version you’re using:
java -version
The output should be something like:
Java(TM) SE Runtime Environment (build 8.0.4+11) Java HotSpot(TM) 64-Bit Server VM (build 8.0.4+11, mixed mode)
-Method 2 :
Install Java using the Oracle JDK:
Step 1: Update Ubuntu
sudo apt-get update && apt-get upgrade
And install the required package if you don’t have it already installed:
sudo apt-get install software-properties-common
Step 2: Add the Java repository
sudo add-apt-repository ppa:webupd8team/java
And then update your package list again:
sudo apt-get update
Step 3: Install Java
Currently, Java 9 is considered stable, though you’ll find many other outdated tutorials saying 9 is still a “developer/beta/preview” release, it’s actually stable. So you should install Java 9. Java 10 should be released soon (March 2018).
So to install the JDK 9th (stable) version, run the following command:
sudo apt-get install oracle-java9-installer
If, for any reason, you need the 8th version, run the following command:
sudo apt-get install oracle-java8-installer
And that’s it. You can now configure your Java
Configure your Java
Set the JAVA_HOME variable
You’ll most likely need to set the JAVA_HOME variable so other applications can find the location of your Java installation. To find the Java installation path, run the previous command again:
update-alternatives --config java
And copy the installation path – second column – under “Path”.
Next, open the file “/etc/environment” with a text editor
nano /etc/environment
And add the following line at the end of the file:
JAVA_HOME="/your/java/installation-path"
Of course, make sure you update the path with the one you previously copied, example:
JAVA_HOME="/usr/lib/jvm/java-9-oracle"
Save the file and then reload it:
source /etc/environment
To test if everything’s done right, you can check your JAVA_HOME variable using:
echo $JAVA_HOME
And the output should be your Java installation path.
Install Android Studio
Download ZIP archive for Linux from: https://developer.android.com/studio/install.html 1. move the .zip to /opt 2. extract it 3. chown the folder to your name 4. chmod 777 studio.sh and run it for the installer
Now the android sdk is installed to ~/Android/Sdk It's preferred to add ~/Android/Sdk folders to your path:
using ubuntu terminal :
export PATH=${PATH}:~/Android/Sdk/tools export PATH=${PATH}:~/Android/Sdk/platform-tools
```
Run android, install the images (atom, etc) and then navigate to Tools -> Manage AVDs and create a new image Make sure to install the android-23 version and confirm it exists in ~/Android/Sdk/platforms/
FYI: Worked like a charm. Bt I'm using Ubuntu 17.10
hope this helps! by QAL.