Set up Android Development Environment for Linux
Set up android development environment for your Linux Machine ? yea its a bit complex based on the distro you are using , If you using popular distro like Ubundu its much easier but if you are using some other like Arch or Manjaro it may get complex.
I am also faced such an issue , previously my distro was Linux Mint (Debian) so there is no such issue facing while set up android environment. But When I switch to Arch based Manjaro Linux the things get changed, Android SDK is available with AUR package in Manjaro but when I tried to install it gets failed during the package build time.
So I think instead of adding android sdk via CLI or software manager , manually set up android development environment for my Manjaro linux. The thing is quite easy just download the android sdk for linux from Android Developer website there you can see android developer site is suggesting Android Studio , Its a great IDE for developing native android application, but if you are planning to build Hybrid app or your system resources are limited (bcoz Android Studio required a minimum of 8GB of ram and better processing power for smooth run). In that case you just need to download stand alone android sdk package only. that you can found at other download section SDK tools only.
Now you need a JDK for running android sdk. so just download a latest compatible version JDK from Oracle web site. I’m using Java SE Development Kit 8u51 , package file jdk-8u51-linux-x64 for my arch distro.
Now you have Android SDK and JDK ready , you may have few dependency packages as well. make sure you already installed following packages.
lib32-libstdc++5 lib32-libx11 lib32-ncurses lib32-zlib lib32-sdl lib32-libxext
Lets Set up android development environment for your Linux distro, Its works on all Linux distro.Step 1
simply extract the downloaded zip files Android SDK and JDK to your home (or your preferred localtion). make sure both folders have all the files. In my case for android sdk the folder name is android-sdk-linux and JDK is just jdk.
Now simply open you environment variable files, it may vary based on distro you are using. If you are using Debian based you can use .bashrc or .bashprofile file. If you are in Red hat or Arch based distro it might be /etc/profile in arch based system you can also use other files too
, /etc/bash.bashrc and /etc/environment.
Now just open this file any one of them (in my case it is /etc/profile) with your preffered editor.
sudo vim /etc/profile
Then add the following path to your file for set up android environment variable . like ANDROID_HOME and JAVA.
bin"export PATH=$PATH:"/home/User/ android-sdk-linux/tools"export PATH=$PATH:"/home/User/ android-sdk-linux/build-tools"export ANDROID_HOME="/home/User/ android-sdk-linux/"
In the above path User should be your user name and path should be your preferred path you use to extract the zip file before.
now just update your environment variables by using following command based on your distro the file name may change.
sudo source /etc/profile
Now just run following command in your CLI.
it will open up the android sdk manager now simply choose the sdk versions and build tools you required to work with.
and just mark and install the required versions.
Its simple and done, You have set up android development environment for you favorite Linux distro. expect some good hybrid app development tutorial soon.
Happy reading .. 🙂 🙂 🙂