Prepare your Ubuntu Linux development environment and ensure it meets the system requirements.
First, boot up Ubuntu Linux,make sure you have an implementation of the
Java JDK installed on your system, whether it is OpenJDK or Oracle Java
JDK, which lays the foundation for the Android SDK. If you don't have
the Java JDK installed on your system please install it, you can obtain
the Oracle Java JDK from Download the Oracle Java JDK,for more information on:
this command installs OpenJDK JRE( Java Runtime Environment ) on your system
You have choice between installing OpenJDK or installing Oracle Java. I strongly recommend installing Oracle Java because it is usually the most well maintained and up to date version of Java.
If you are running a 64-bit distribution of Android SDK on your development machine, you need to install the ia32-libs:
Type/Copy/Paste: sudo apt-get install ia32-libs
This command installs additional libraries needed for development with the Android SDK
Type/Copy/Paste: javac -version
this command checks for the Java JDK on your system:
It should respond back with:
javac 1.7.0
or something very similiar
Type/Copy/Paste: java -version
this command checks for the Java JRE ( Java Runtine Environment ) on your system
Download and Configure Eclipse Integrated Development Environment (IDE)
You want to make sure
you have the Eclipse Integrated Development Environment (IDE) installed
on your system,for example select Eclipse Classic, and download the
version for your system architecture such as 32bit or 64 bit version for
Linux. If your computer system has 4GB or more of memory most
likely it is a 64 bit computer. You can tell if your Ubuntu Linux
operating system is 32 or 64 bit by opening up a terminal and running
the following command:
Type/Copy/Paste: file /sbin/init
Download Eclipse IDE it will download into your /home/"your_user_name"/Downloads
Select the correct bit version for your corresponding system
architecture. For example, if you are on 32-bit Ubuntu Linux select
32-bit Eclipse IDE and if you are on 64-bit Ubuntu Linux select 64-bit
Eclipse IDE.
This is an example of a 64-bit Eclipse IDE setup on 64-bit Ubuntu Linux operating system.
Type/Copy/Paste: cd /home/"your_user_name"/Downloads
this command makes the eclipse binaries executable for all on the system
Type/Copy/Paste: sudo -s tar xvzf eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz
this unpacks your Eclipse IDE compressed binaries
Type/Copy/Paste: exit
this command takes you out of root user
Open up a terminal and enter the following commands:
Type/Copy/Paste: cd /home/"your_user_name"/Desktop
this will change you into your user Desktop, make sure you are not root
Type/Copy/Paste: ln -s /usr/local/eclipse/eclipse
Type/Copy/Paste: chown "your_user_name" eclipse
this will make the Eclipse symbolic link located on your desktop belong to the user
Important, make sure you are not root when you create this
symbolic link from your Eclipse IDE /usr/local/eclipse directory to your
Desktop /home/"your_user_name"/Desktop
Download, Install and Configure the Android SDK
Download the Android SDK, click on the Linux tarball, android-sdk_r22-linux.tgz and save it to your /home/"your_user_name"/Downloads directory, open up a terminal and run the following commands:
Type/Copy/Paste: cd /home/"your_user_name"/Downloads
this will change you into your Downloads directory
this will install the ADT plugin tool for all users on the system
Install the ADT Plugin for Eclipse, the ADT is a plugin for the Eclipse IDE.
Before you can install or use ADT, you must have a compatible version
of Eclipse installed on your development computer. Start Eclipse, then
select Help > Install New Software. Click Add, in the top-right
corner. In the Add Repository dialog that appears, enter "ADT Plugin"
for the Name and the following URL for the Location
Note: If you have trouble acquiring the plugin, try using "http" in
the Location URL, instead of "https" (https is preferred for security
reasons)
In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
In the next window, you'll see a list of the tools to be downloaded and
Click Next. Read and accept the license agreements, then click Finish.
Note: If you get a security warning saying that the authenticity or validity of the software can't be established, click OK.
When the installation completes, restart Eclipse.
Configuring the ADT Plugin, after you've successfully downloaded the
ADT as described above, the next step is to modify your ADT preferences
in Eclipse to point to the Android SDK directory:
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. You cannot continue with this procedure until
you click Proceed.
For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory, which should be /opt/android-sdk-linux
Click Apply, then OK.
Add Android platforms and other components to your SDK
Adding Platforms and
Other Component,in setting up your SDK is using the Android SDK and AVD
Manager (a tool included in the SDK starter package) to download
essential SDK components into your development environment. The SDK
starter package, which you've already downloaded, includes only a single
component: the latest version of the SDK Tools. To develop an Android
application, you also need to download at least one Android platform and
the associated platform tools. You can add other components and
platforms as well, which is highly recommended.
Open Eclipse and click Window->Android SDK and AVD Manager->Installed packages and click update all. Simply click Install to accept the recommended set of components and install them
On Linux, open a terminal and navigate to the /opt/android-sdk-linux/tools directory in the Android SDK.
Type/Copy/Paste: sudo -s
Type/Copy/Paste: cd /opt/android-sdk-linux/tools
this will change you into the android sdk tools directory
Type/Copy/Paste: ./android
this command will run the Android graphical user interface, in most
cases you will have to be root user in order for the Android SDK to
download updated components to the opt/android-sdk-linux directory.To
download components, use the graphical UI of the Android SDK and AVD
Manager to browse the SDK repository and select new or updated
components. The Android SDK and AVD Manager installs the selected
components in your SDK environment.
Create your Android Virtual Device (AVD)
Once all the components for Android have been updated you will need to create an Android Virtual Device.
Click on Window->Android SDK and AVD Manager->Virtual Devices in order to create a Android Virtual Device ( emulator ).
Click New, scroll down to the box that says name and assign an Android Virtual Device name such as: My_AVD
Next click on the box that says target and use the arrow button and
scroll down and select appropriate Android version you want to develop
with such as, Android 3.2-API Level 13.
Next scroll down to the box that says Skin and Click on Resolution,
enter the numbers 420x580 and select Create AVD, this will create your
Android Virtual Device ( emulator ), for program testing.
Congratulations,
you should now have the Android SDK setup to work with Eclipse IDE and
you can begin developing Android Applications.
EmoticonEmoticon