October 19, 2015 | Article | 1 Comment
Android Operating System is one of popular operating system for mobile device beside Windows Phone, Apple iOS, etc. The popularity comes from the fact that Android is open source, used by various vendor. You have a freedom to modify and do anything to your Android, though you will void your warranty.
Why Eclipse? Eclipse is an open source Integrated Development Environment and has full support for Android. It’s also quite simple.
In the time i write this article, I use GNU/Linux Ubuntu 10.10. Of course you can use other linux distribution if you like, especially Debian or Ubuntu derivative distribution. I might encourage you to use later version if possible. You must also have active internet connection to do installation and fetching required packages.
Table of Content
- Create Android Virtual Device
[x] Installing Eclipse IDE
First, installing Eclipse. In this article I will use latest Eclipse (per September 6th, 2012) version. It’s Eclipse 4.2 Juno for Linux 32 bit. You can download it at this link.
I pick eclipse-SDK-4.2-linux-gtk.tar.gz, it is a ready to use version means no installation required. Download it and then extract the file.
tar xvzf eclipse-SDK-4.2-linux-gtk.tar.gz
We will have a new extracted directory named eclipse. Move this directory to /opt. This is a good practice for FHS (Filesystem Hierarchy Standard) as an optional software installed to this. In my case I extracted eclipse in /home/xathrya/Downloads. I will invoke following command and remember the command need privileges as /opt is usually owned by root:
mv /home/xathrya/Downloads/eclipse /opt
Create symbolic link to eclipse in /usr/bin (use root privilege):
ln -s /opt/eclipse/eclipse /usr/bin/eclipse
[x] Installing Oracle Java (Replace OpenJDK)
You can use OpenJDK and skip this. However if you want
Next you must have a running JAVA Runtime Environment. We need to install Oracle Java. Ubuntu has come with a default OpenJDK Environment so we will replace it.
In Ubuntu, the JAVA is located on repository partner which indicated it is a proprietary repository. To install JAVA first we have to add the repository. In this case I use maverick meerkat (Ubuntu 10.10 distribution), if you have other distribution, you can replace maverick with your Ubuntu codename (ex: lucid for lucid lynx, natty for natty narwhal)
sudo add-apt-repository "deb http://archive.canonical.com/ maverick partner" sudo apt-get update
After that you can install JAVA JRE
sudo apt-get install sun-java6-jre galternatives
last we need to change the default java environment for OpenJDK to Sun JRE 6
Select java in left panel and select java-6-sun as shown by image below:
Now, verify your java installation. Invoke this command:
This should gives you message like this:
java version "220.127.116.11_22" Java(TM) SE Runtime Environment (build 1.6.0_22-b04) Java HotSpot(TM) Client VM (build 17.1-b03, moxed mode,sharing)
[x] Android Developer Tool Plugin
Now let’s moving to installation of Androit Developer Tool (ADT). It is a special Eclipse plugin contains integrated android environment for building Android application using eclipse. Reminder: my eclipse version is 4.2 (Juno)
Start eclipse. Now navigate to:
Help - Install New Software - Add
enter the following information:
Name: ADT Plugin Location: https://dl-ssl.google.com/android/eclipse/
Click on OK. Now select “Developer Tools” and/or “NDK Plugins”. Click Next to begin installation. Wait for installation to finish its work. With my connection around 50KB/s the installation done in 30 minutes.
[x] Install the SDK and SDK Platform
Next we will install Android SDK. Downlad Android SDK starter pack from this link
Download the latest SDK. By the time I write this article, the latest version is 20.0.3. You can download linux version directly in this link:
Extract the content of Android SDK pack:
tar xvzf android-sdk_r20.0.3-linux.tgz
In my case I will leave the SDK on /home/xathrya/android-sdk.
Now we need to install platforms and optional additional plugins or sample codes. Start SDK manager:
Seleck SDK Platforms you want. I choose Android 2.3.3 API 10 as my smartphone Sony Xperia U use this one. When you have selected all packages you want, click Install Selected. You will be prompted to Accept License. Click Accept All and then Install.
Create Android Virtual Device
Now we have to join Eclipse IDE with Android SDK and create and Android Virtual Device (AVD). Android Virtual Device is an emulator to run your application on top of your computer.
In Eclipse, navigate to: Window -> Preferences -> Android
Enter location of your Android SDK installation. In my case it is in /home/xathrya/android-sdk/. Press OK.
Now navigate to Window -> AVD Manager -> New
Insert following information into:
Name: AndroidVirtualDevice Target: [chose any desired Android version and API level available]
Click Create AVD. The new Android Virtual Device will be created in the directory:
We are done!android, development, ubuntu