Monday, April 26, 2010

Android SDK, Eclipse and Ubuntu (Linux)

This tutorial shows installation of Android SDK on Eclipse 3.5.1 @Ubuntu 9.10.

Things needed:
1) Latest version eclipse. Can download from Eclipse Downloads. Any version is fine.

From Terminal:
sudo apt-get install eclipse
2) Latest version Java SDK. Click here for Sun Java Downloads. We require Java Development Kit and Java Run Time.

From Terminal:
sudo apt-get install sun-java6-jdk sun-java6-jre sun-java6-plugin
3) Download the latest Android SDK, appropriate for you. In our case, it is Linux i386. Save the tar file to your Desktop. Extracting it will create a folder with name 'android-sdk_r05-linux_86'.

Instructions:
1) Before we start the process, lets upgrade and update all the packages.

From Terminal:
sudo apt-get upgrade
sudo apt-get update
2) Now, you have all your applications updated. Next, we need to place the Android SDK to a location where the compiler can look at. I am going to copy the folder 'android-sdk_r05-linux_86' to 'usr/local/' folder.

Go to the Desktop location:
uday@pricksaw:~$ cd Desktop

Then, copy the folder to '/usr/local'
uday@pricksaw:~/Desktop$ sudo cp -r android-sdk-linux_86 /usr/local
Check the PATH variable has the location /usr/local/
echo $PATH
3)Now, you have access to Sun JDK. Android gives additional support to Eclipse via ADT plugin. We need to install the plugin for better functionality.

Open Eclipse, Applications >> Programming >> Eclipse
From the Help Menu >> Install New Software...,
Add the Android ADT site location, 'https://dl-ssl.google.com/android/eclipse/'
Go ahead and install them.

4) You need to link the Android SDK to Eclipse.
On Windows Menu >> Preferences... ; you would see the Option for Android >> SDK Location.

Browse to the location where you copied your SDK; in our case usr/local/

Have a look at the image...

Hit Apply and OK.

5)Select the SDKs you need from Windows >> Android SDK and AVD Manager.

Go to Available Packages...
Select the
latest SDK Plaform Android (API 7)
latest Android SDK Tools (revision 5)
latest Samples for SDK API (API 7)
latest Documentation for Android SDK (API 7)

Here is an image of installed components...

Create a Virtual Device...
Select the Virtual Devices under Android SDK and AVD Manager
Select New...

Add details as shown in the picture below... you can customize the name of the device.
Now, Click create AVD.

6) Now, we are all set to start a project.

File >> Other...

Android >> Android Project...

No comments: