Android Development Environment Building

Source: Internet
Author: User

1. Installing the JDK

First download the Linux version of the JDK to Oracle's official website at: http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u26-download-400750.html

The choice is Linux x86-self extracting Installer, approximately 81.2M.

After the download, of course, you can run the installation directly. Start the CP file in your installation directory and execute it directly in your installation directory:

./jdk-6u26-linux-i586.bin (Of course, if execution fails because there is no execute permission, then you need to add Execute permission: chmod +x./jdk-6u26-linux-i586.bin)

The installer will automatically install the JDK1.6.0_26 directory to your current directory.

The program is installed, and then the environment variable needs to be set.

Perform:

???? sudo gedit/etc/profile

Add the following section 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, then log off the current user (or shut down), log back in, and the environment variable is in effect.

?

Verify that the installation is successful:

Perform:

Java-version

If it appears:

Java Version "1.6.0_26"

Java (TM) SE Runtime Environment (build 1.6.0_26-b06)

Java HotSpot (TM) Server VM (build 20.0-b11, Mixed mode)

?

This kind of information, it means OK.

Note that Ubuntu has OPENJDK installed by default, so you do not install the JDK, do Java-version will not error, but the reported information and installed JDK is not the same, please note the distinction.

?

2. Install Eclipse

?

At present, the official 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.

?

The address of the download eclipse is: http://www.eclipse.org/downloads/

?

I am downloading 32bit linux:

?

Eclipse IDE for Java developers, 98 MB, this is a basic package developed by Javase, it is recommended to download the classic version, note that the latest ADT requires that eclipse must be 3.5 or higher.

File name: eclipse-java-helios-sr1-linux-gtk.tar.gz

Of course the first is decompression, execute the command:

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

After the decompression is successful, an Eclipse directory appears. This directory is installed Eclipse, enter this directory, execute Eclipse file, you can start eclipse.

You can go in and write a simple program, compile and execute, to verify that the ECLISPE is working properly, and you will find that the compilation execution speed of Eclipse under Linux is faster than that of Windows.

Of course, you can also set up your own desktop shortcut, easy to use (see How to create a desktop shortcut).

?

3. Download and install the Android SDK Starter package

?

Android SDK Starter Package This is just the core basic tool of the SDK, with it, then use its management tool to download other parts you need to. Do you see an Android script file in this directory? Executing it will launch the Android SDK and AVD Manager, which can help you download other parts you need, and can also create a simulator.

?

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

?

Download next to file is: android-sdk_r11-linux_x86.tgz, about 26M.

?

The next course is unpacking: Tar zvxf android-sdk_r11-linux_x86.tgz

?

After unpacking, the Android-sdk-linux_x86 directory will appear in the current directory. This directory is the basic tool of the SDK. Remember this directory, because you will need this directory in the future when you run the tool or set up ADT!

?

4. Installing the ADT (Android development Tools) Plugin

?

The ADT plugin is a plugin for Google's official development of Eclipse, which is designed for Android app development.

?

Start Eclipse, then select Help > Install New software ....

Click the Add button in the upper-right corner

In the pop-up Add Repository dialog box, the Name column fills in "ADT Plugin", there are two choices in the Location column, and one is filled with the download URL: Https://dl-ssl.google.com/android/ eclipse/, so you can download the installation online.

???? The second option is if I have already downloaded ADT Plugin, then click the Archive button next to directly find the plug-in to the package, for example, I use the second kind, I have downloaded, the file name is adt-11.0.0.zip,5.3m. Regardless of that, finally choose OK, you can.

Then, in the list of software below, select the checkbox in front of the developer SDK tools and click on the Next button below and wait for the installation progress bar to complete, where the list of installed software will appear, you can click Next, and then the license will appear. You have to choose Agree, and then click Finish to finish (of course there is a download process that may take a little time). After the installation is complete, restart Eclipse.

?

5. Configuring the ADT Plug-in

?

The content of the configuration is to modify the reference to the ADT plugin in eclipse to point to, need to point to the previous installed Android SDK directory, remember this directory?

?

Start Eclipse, select Window > Preferences.

In the pop-up Preferences dialog box, select the Android tab on the left and the right SDK location to select the directory of your Android SDK. For example, I go to the directory is:/home/jackwong/android-sdk-linux_x86, then click Apply, then click OK.

In this process, a dialog will pop up asking if you want to participate in Google's satisfaction survey report. You can choose to join or not. Click the Process button.

Once installed, you can use the Help > Check for updates option to keep ADT up-to-date.

?

A missing tool will be prompted after eclipse restarts to download using the Andriod Manager tool (this tool eclipse only)

?

6. Add Android OS and widgets

?

So far, the basic configuration is pretty much the same, but in order to develop Android apps, you must also add an Android operating system for the simulator to emulate your application. Of course there are some other parts that need to be installed. This is done through the Android SDK and AVD Manager in the SDK Toolkit. Of course, this program can be launched directly in Eclipse: Window > Android SDK and AVD Manager.

?

Of course, you can also run the Android script directly under the Tools directory in the SDK directory to launch it.

?

The recommended parts are generally:

?

SDK Tools, which you have installed the SDK starter package is actually ready.

?

SDK Platform-tools, this to install.

?

SDK platform, this requires at least one. That is, the operating system, you can download multiple, such as 2.2,3.1 you can download, but at least one must, because the simulator is required to run. So, if you want to test all kinds of platforms, then you need to download one of the various versions of Android.

?

I downloaded the SDK platform-tools 5 and Android 3.1,android compatibility package three packages.

?

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

?

PS because Google server will be banned, can fq, or)

Under Linux Use the command sudo vim/etc/hosts to edit the Hosts file, which is also added at the end of the file

74.125.237.1 dl-ssl.google.com

Then run the SDK manager again and you can download it.

Android Development Environment Building

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.