Hi guys, at this time I will share how to integrate Android SDK and Eclipse IDE in Ubuntu.
First
thing first, you must have Oracle Java JDK or OpenJDK (free and open
source :D) installed on your system before installing Android SDK. Don't
forget to connect your PC or Notebook to Internet to download and
install what we need, prepare your coffee and let's start :D
1. Prepare your Development Environment
- If you don't have installed OpenJDK and JRE on your system yet, you must install it first, you can download the binary from here or you can install it using apt like this:
sudo apt-get install openjdk-7-jdk && openjdk-7-jre
- If you are running a 64-bit distribution of Android SDK on your development machine, you need to install the ia32-libs
sudo apt-get install ia32-libs
- Open terminal and type
javac -version (check java compiler version)
java -version (check java version)
2. Download and Configure Eclipse Integrated Development Environment (IDE)
- You can install it using apt-get or you can download it from here. If you are using apt-get, just type into terminal
sudo apt-get install eclipse (this will download and install eclipse)
- If you have downloaded it from Eclipse site you must select the correct bit version for your corresponding system architecture, if you are on 32-bit Ubuntu then select 32-bit Eclipse IDE and if you are on 64-bit Ubuntu then select 64-bit Eclipse IDE but I won't explain how to use and configure 64-bit Eclipse IDE because I am on 32-bit Ubuntu :). Install it from Ubuntu repository is recommended.
- I assume you have download and installed it, then we will go to the next step
3. Download, Install and Configure the Android SDK
- Download Android SDK, select the Linux tarball (android-sdk_r22-linux.tgz) and save it anywhere you want, assume we have it on /home/user/Downloads directory, open up terminal and type:
cd /home/user/Downloads (this will change into Downloads directory)
sudo cp -r android-sdk_r22.tgz /opt (this will copy downloaded android-sdk to /opt directory)
cd /opt (this will change you into the Android working directory)
sudo tar xvzf android-sdk_r22-linux.tgz (this will extract android-sdk_r22-linux.tgz)
sudo -s chmod -R 755 /opt/android-sdk-linux (this will make Android working directory writeable and executable for all users on the systems)
- Now you have Android SDK located at /opt/android-sdk-linux on your Ubuntu, our next step to add Android SDK to the system wide PATH on Ubuntu, type in terminal
sudo nano /etc/profile or sudo gedit /etc/profile
add the following lines below to the end of the system PATH file
export PATH = ${PATH}:/opt/android-sdk-linux/tools
export PATH = ${PATH}:/opt/android-sdk-linux/platform-tools
save it (if using nano ctrl + o then ctrl + x to close it)
- Reload your system PATH /etc/profile by type in terminal:
. /etc/profile4. Install the Android Development Tool (ADT) Plugin for Eclipse IDE
- Start Eclipse, then select Help => Install New Software. Click Add in the top-right corner. In the Add Repository dialog, enter "ADT Plugin" this just title and you can change it whatever name you want, and URL with the following URL location
https://dl-ssl.google.com/android/eclipse/
- Then click OK
- In the Available Software dialog, select Developer Tools and click Next. In the next window you will see a list of the tools to be downloaded then click Next. Accept all license agreements, then click Finish. (If you get a security warning saying that the authenticity or validity of the software can't be established, ignore this and click OK
- When the installation complete, restart Eclipse. After you've successfully download the ADT, the next step is to modify your ADT preferences in Eclipse to point to the Android SDK directory which we described it before.
- Select Window => Preferences... to open the Preferences Panel.
- Select Android from the left panel. You may see a dialog asking whether you want to send usage statistics to Google. If so, make your choice and click Proceed.
- Click Browse in the main panel and locate your Android SDK directory which should be /opt/android-sdk-linux.
- Click Apply, then OK.
5. Add Android platforms and other components to your SDK
- To
create Android Project you must have at least one Android platform and
the associated platform tools, you can choose whatever you want from
Android SDK Manager.
- To launch Android SDK Manager type in terminal:
/opt/android-sdk-linux/tools/android
- This will open graphical user interface of Android SDK Manager then you can choose Android 2.3.3 and Android 4.2 to be downloaded.
6. Create your Android Virtual Device (AVD)
- Open terminal and type:
/opt/android-sdk-linux/tools/android avd
- This will open AVD Manager then create your Android Virtual Device
Congratulations,
you should now have the Android SDK setup to work with Eclipse IDE and
you can begin developing Android Applications.
Happy Coding :)
0 comments
Post a Comment