Sunday, May 19, 2013

Guide : Installing Android Studio on Ubuntu

May Allah`s peace , mercy and blessing be upon you

Hi, if you watched (or assisted -if you are that lucky-) the Google I/O then you couldn't resist installing the new Android development environment the early access preview. Android Studio the IDE built on IntelliJ IDEA with a lot of features for Android development and debugging, making the process faster and more productive. Coming with extensible build tools, powerful code editing, smoother and richer GUI .. you can read these stuff here.

So, if you are like me, an Eclipse/ADT user you must wonder why they went with IntelliJ IDEA instead of Eclipse ? they responded with : "Because when we did just Eclipse, people kept asking for IntelliJ support" , "We will support both Eclipse and the new IntelliJ-based Android Studio. Eclipse support is not going away". Eclipse is still supported but I'm not that loyal :) to the IDE to stick with it.
Then let's talk about installing on Ubuntu (this instructions are tested on 12.10 64-bit) :
First you'll need to install Oracle Java JDK (now 7.21u) from the official website  For Linux 64-bit tar.gz , you don't need to install it if you have OpenJDK installed, so just copy it to a location :
tar xzvf ~/Downloads/jdk-7u21-linux-x64.tar.gz
sudo mv jdk1.7.0_21/ /usr/lib/jvm/
Maybe you'll need to install some libs because of some issues with adb
apt-get install lib32ncurses5 ia32-libs
Then you need to set JAVA_HOME to JDK location, to define it on login use .profile file if you don't have one copy the default one from /etc/profile.
cp /usr/profile ~/.profile
And add the definition and logout/login to apply changes :
export JAVA_HOME="/usr/lib/jvm/jdk1.7.0_21"
Now download Android Studio and extract it :
tar xzvf ~/Downloads/android-studio-bundle-130.677228-linux.tgz
then copy it to some location, I used /usr/bin
sudo mv ~/Downloads/android-studio  /usr/bin/android-studio
I added a bigger icon to the directory to use in launcher :
sudo mv ~/Downloads/AndroidStudioIcon-150x150.png  /usr/bin/android-studio/icon.png

To add the IDE to the launcher you need to define a desktop file in /usr/share/applications name it android-studio.desktop with the following content :
[Desktop Entry]
Name=Android Studio
Comment=Android Studio IDE
That's it, now you can start the app from the launcher on Unity or Gnome normally, also you can switch to the dark theme like the one in the I/O from View > Quick Switch Scheme > Switch Look And Feel > Darcula .

No comments:

Post a Comment

Zoli Issam's blog proudly powered by Blogger | All rights reserved Jaw,B 2010-2013