Build an Android development environment in Ubuntu 11.04

Source: Internet
Author: User

Build an Android development environment in Ubuntu 11.04

1. Install JDK

First go to the Oracle official website to download the linux version of JDK, URL: http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u26-download-400750.html

I chose Linux x86-Self Extracting Installer, which is about 81.2 M.

After downloading the file, you can directly run the installation. First, cp the file to your installation directory, and then directly execute it in your installation directory:

./Jdk-6u26-linux-i586.bin (of course, if the execution fails because there is no execution permission, you also need to add the execution permission: chmod + x./jdk-6u26-linux-i586.bin)

The installer will automatically install it to the jdk1.6.0 _ 26 directory of the current directory.

After the program is installed, you need to set the environment variable.

Run:

Sudo gedit/etc/profile

Add the following parts to the configuration file:

Export JAVA_HOME =/home/jackwong/jdk1.6.0 _ 26
Export JRE_HOME =/home/jackwong/jdk1.6.0 _ 26/jre
Export PATH =/home/jackwong/jdk1.6.0 _ 26/bin: $ PATH
Export CLASSPATH =.:/home/jackwong/jdk1.6.0 _ 26/lib:/home/jackwong/jdk1.6.0 _ 26/jre/lib

Save, log off the current user, and log on again. The environment variable takes effect.

Verify whether the installation is successful:

Run:

Java-version

If:

Java version "1.6.0 _ 26"
Java (TM) SE Runtime Environment (build 1.6.0 _ 26-b06)
Java HotSpot (TM) Server VM (build between 0-b11, mixed mode)

This information indicates OK.

Note: openjdk has been installed in ubuntu by default. Therefore, even if you do not install jdk, no error will be reported when you execute java-version. However, the reported information is different from that when jdk is installed.

2. Install eclipse

Currently, the officially recommended development environment is eclipse + ADT. Of course, you can use any other development environment, but I chose the official recommendation because everything is free.

Download eclipse address: http://www.eclipse.org/downloads/

I downloaded 32bit linux:

Eclipse IDE for Java Developers, 98 MB. This is a basic package for javaSE development. We recommend that you download the classic version. Note that the latest ADT requires eclipse To Be A version later than 3.5.

Name: eclipse-java-helios-SR1-linux-gtk.tar.gz

Of course, the first step is to decompress the package and execute the command:

Tar zvxf eclipse-java-helios-SR1-linux-gtk.tar.gz

After decompression, an eclipse directory appears. This directory is the installed eclipse. Enter this directory and execute the eclipse file to start eclipse.

You can write a simple program and compile and execute it to verify whether eclispe works normally. You will find that eclipse compilation and execution speed in linux is faster than that in windows.

Of course, you can also set up a desktop startup shortcut for ease of use.

3. download and install the Android SDK Starter Package

The Android SDK Starter Package is only the core basic tool of the SDK. With it, you can use its management tool to download other required tools. Is there an android script file in this directory? After you execute this tool, the Android SDK and AVD Manager will be started. This tool can help you download other required parts and create a simulator.

Yes: http://developer.android.com/sdk/index.html

The downloaded file is: android-sdk_r11-linux_x86.tgz, about 26 M.

Next Of course is unwrapped: tar zvxf android-sdk_r11-linux_x86.tgz

The android-sdk-linux_x86 directory will appear under the current directory after unpacking. This directory is the basic sdk tool. Remember this directory, because this directory will be required when you run the tool or set the ADT later!

4. Install the ADT (Android Development Tools) plugin

The ADT plug-in is an Eclipse plug-in officially developed by google and is specially prepared for Android Application Development.

 

  • Start Eclipse, and select Help> Install New Software ....
  • Click Add in the upper-right corner.
  • In the Add Repository dialog box that appears, enter "ADT Plugin" in the Name column", In the LocationThere are two options in the column. One is to enter the download URL: https://dl-ssl.google.com/android/eclipse/, which can be downloaded and installed online. The second option is if I have downloaded ADT plugin, 5.3 M. Select OK.
  • In the software list below, select the checkbox in front of Developer SDK Tools, click the next button below, and then wait until the installation progress bar is complete. A list of installed software is displayed, you can click Next, and then the license will appear. You must select agree and click finish to complete the download process (of course, it may take some time ). After the installation is complete, restart eclipse.

5. Configure the ADT plug-in

The configuration content is to modify the reference pointing to the ADT plug-in eclipse. It needs to point to the previously installed Android SDK directory. Do you still remember this directory?

Start eclipse and select Window> Preferences ..

In the pop-up Preferences dialog box, select the Android tag on the left and the directory of the Android SDK on the right. For example, I went to the directory:/home/jackwong/android-sdk-linux_x86, then click apply, and then click OK.

In this process, a dialog box is displayed asking if you want to participate in the google satisfaction survey report. You can choose whether to participate or not. Click the process button.

After installation, you can use the Help> Check for Updates option to keep the ADT up-to-date.

6. Add the Android operating system and components

So far, the basic configurations are almost the same. However, to develop an android Application, you must add an android operating system to simulate your application. Of course there are some other components that need to be installed. It is actually done through the Android SDK and AVD Manager in the SDK kit. Of course, you can directly start this program in eclipse: Window> Android SDK and AVD Manager.

Of course, you can also directly run the android script under the tools directory under the sdk directory to start.

The recommended parts are generally:

SDK Tools. You have installed the sdk starter package.

SDK Platform-tools, which must be installed.

SDK platform, which requires at least one. That is, you can download multiple operating systems, such as 2.2 and 3.1, but at least one, because the simulator is required for running. Therefore, if you want to simulate and test various platforms, You need to download one for all versions of android.

I downloaded three packages: SDK Platform-tools 5, Android 3.1, and Android Compatibility Package.

After the download is complete, the Android development environment is ready.

For more details, please continue to read the highlights on the next page:

How to configure the compiling environment of Android 14.04 kitkat on Ubuntu 4.4 x64

Build an Android Development Environment on Ubuntu 12.04

Configure the Android SDK development environment in Ubuntu 14.04

Build the Android development environment under 64-bit Ubuntu 11.10 (JDK + Eclipse + ADT + Android SDK details)

Install Android SDK on Ubuntu 12.10x64

  • 1
  • 2
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.