Android development environment builds Eclipse's configuration diagram

Source: Internet
Author: User
Tags http request android sdk manager java se
Important, when updating the Android SDK, you need to have a ladder to prepare the Hosts file
The development environment of Windows Installer Android is not simple or complicated, this article wrote to the first time I want to build Android development environment on their Windows Android wave of friends, in order to ensure that everyone can successfully complete the development environment, the article is written as detailed as possible, Hope to help friends who are ready to enter Android development.
This tutorial will be divided into five steps to complete the deployment of the Android development environment.
First step: Install JDK.
Step Two: Configure the variable environment for the JDK on Windows.
Step three: Download and install Eclipse.
Fourth step: Download and install the Android SDK.
Fifth step: Install the ADT plug-in for Eclipse.

First step: Install JDK

To download the Oracle Company's JDK, Baidu "JDK" enters the Oracle Company's JDK download page (the current download page address is http://www.oracle.com/technetwork/java/javase/downloads/ index.html), select the corresponding version of your computer system.
After downloading to the local computer, double-click to install. After the JDK default installation is successful, there will be two folders in the system directory, one for JDK and one for JRE.
The full name of the JDK is the Java SE Development Kit, the Java Development Toolbox. SE represents the Standard Edition. The JDK is the core of Java, which contains the Java Runtime Environment (Java Runtime Environment), a bunch of Java tools, and Java class libraries that are invoked when developers develop applications.
We can open the Bin directory in the JDK installation directory, which has many executable programs named EXE, which are the tools that the JDK contains. In the second step, we can easily invoke these tools and their commands by configuring the JDK variable environment.
The basic tools included in the JDK are:
Javac:java the compiler to turn the source code into bytecode.
Jar: The packaging tool that packs the related class files into a single file.
Javadoc: Document builder, extracting documents from source comments.
Jdb:debugger, debugging error-checking tool.
Java: Running a compiled Java program.
Step Two: Configure the variable environment for JDK on Windows
A lot of people just learning Java development in accordance with the online tutorials can easily configure the Windows JDK variable environment, but why this configuration and do not think much.
We usually open an application, usually through the desktop application icon double-click or click on the System Start Menu Application Menu link, whether the Desktop shortcut icon or menu link contains the application installation location information, When they are opened, the system will locate the installation directory and start the program according to the location information.
Know the location of an application installation directory, we can also open through the command line tool, such as QQ location: C:\Program Files (x86) \tencent\qq\qqprotect\bin, The QQ application name is QQProtect.exe, then we open the command line tool, then enters to "C:\Program Files (x86) \tencent\qq\qqprotect\bin" The directory, then enters "the Qqprotect", Can run QQ.
If we want to open the command line tool, the direct input "Qqprotect" can start the QQ program, rather than every time to enter the QQ installation directory restart, this time by configuring the system environment variable path to achieve. Right-click My Computer, select Properties, click Advanced System settings on the left in the open window, and the System Properties window, and click Environment variables under the Advanced tab.
Edit the system variable name "path" and append the QQ installation directory after the "path" variable (string content):; C:\Program Files (x86) \tencent\qq\qqprotect\bin Note that when appending, add an English semicolon to the front of the directory string, and the English semicolon is used to differentiate between paths in the path.
Ok save, then back to the command window, no matter in any directory, you just enter the Qqprotect command, QQ will start.
By starting the example of QQ, we conclude that when a system is requested to start an application, the system will look in the current directory first, and if not, find it in the path specified by the system variable path. We said earlier that the JDK contains a bunch of development tools, all of which are under the JDK installation directory, and to facilitate the use of these development tools, it is necessary to set up the system variables for the JDK installation directory. This is why you need to set the JDK's Bin directory as a system environment variable after Windows installs the JDK.
To configure the system variable environment for JDK, we need to set three system variables, namely Java_home,path and classpath. Below is the setting of these three variables to guard against.
Java_home
Set the system variable name first, the variable value is the JDK on your computer installation path: C:\Program files\java\jdk1.8.0_20. Once created, you can use%java_home% as the unified Reference path for the JDK installation directory.
Path
The path attribute already exists and can be edited directly, appended to the original variable:;%java_home%\bin;%java_home%\jre\bin.
CLASSPATH
Set the system variable name: CLASSPATH variable value is:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar.
Note that the variable value string is preceded by a "." Represents the current directory, and the purpose of setting classpath is to tell the Java execution environment in which directories can find the classes or packages that are required by the Java program you are going to execute.
Step three: Download and install eclipse
Eclipse is the IDE developed for Java applications and Android (integrated development environment). Eclipse does not need to install, after the download unpack the unpacked package, cut the Eclipse folder to the place you want to install, open the set up your working directory.
There are several versions of Eclipse, where you choose to download the Eclipse IDE for Java EE developers version.
Fourth step: Download and install the Android SDK
Configuring the JDK variable environment and installing Eclipse, the Java development environment is ready if you are just developing a normal Java application. We're going to develop Android apps through eclipse, so we need to download the Android SDK (Software Development Kit) and install the ADT plugin in Eclipse, which lets Eclipse and Android SDK associated.
The Android SDK provides the API libraries needed to develop Android applications and the development tools needed to build, test, and debug Android applications.
Turning on http://developer.android.com/sdk/index.html, we found that Google offers the Android developer Tools that integrate Eclipse, Because we have already downloaded eclipse this time, we chose to download the Android SDK separately.
After downloading, double-click install to specify the installation directory for the Android SDK, and in order to facilitate the use of the development tools included with the Android SDK, we set the Tools directory under the Android SDK installation directory in the path of the system environment variable.
In the Android SDK installation directory, double-click SDK Manager.exe to open the Android SDK manager,android SDK manage to download or update different versions of the SDK package, we see the default installed Android SDK The manager has only one version of SDK tools installed.
Open the Android SDK Manager, which will get an installable version of the SDK, but there is a wall in the country and sometimes a failure to get there.
From the pop-up log window, we can see that the connection "https://dl-ssl.google.com" failed. We ping the order and found that the network is not through.
From the Almighty Internet, we have found a solution to this problem, and effective.
Change the Host file
First change the host file, the host file in the C:\Windows\System32\drivers\etc directory, with Notepad to open the "hosts" file, the following two lines of information appended to the end of the Hosts file, save it. If you are WINDOWS8 system may not have permissions to modify the host file, you can right-click the Hosts file, the Users group can be set to the Hosts file Full control of the permissions can be.
203.208.46.146 dl.google.com
203.208.46.146 dl-ssl.google.com
The above two lines in the host file mean that local access dl.google.com and dl-ssl.google.com are directed to a server with an IP address of 203.208.46.146.
To change the HTTPS request on the Android SDK manage to an HTTP request
Open the Android SDK Manager, in the Options under Tools, there is a Force https://..sources to be fetched using http://... Check this out and you can do it.
To open the Android SDK Manager.exe, you can normally download the Android version of the SDK. All you have to do is select the installation package that you want to install or update. Here is a time-consuming process, there will be download failure, the failure of the installation package only need to be selected and then installed on it.
If you can not download the Android SDK by changing DNS, there are two methods, the first one is to bring up the ladder Fq, the second is downloaded from this website, the download address is: http://www.androiddevtools.cn/
Step Fifth: Install the ADT plug-in for Eclipse
We have already configured the Java Development environment, installed the Android IDE, and downloaded the Android SDK, but Eclipse has not yet been associated with the Android SDK, which is that they are now independent of each other, like a gun and a bullet separated. To make Android apps easier to create, run and debug, the Android development team customized a plugin for the Eclipse IDE: Android Development Tools (ADT).
Here's how to install ADT online:
Start Eclipse, click on the Help menu-> Install New Software ...?, click the Add in pop-up dialog ... Button.
Then in the pop-up dialog box in the location input: Http://dl-ssl.google.com/android/eclipse/,Name can enter ADT, click the "OK" button.
In the pop-up dialog box, select the tool you want to install, and then the next step is OK.
When installed, you will be asked to reboot Eclipse,eclipse will intelligently associate it with the Android SDK in the same directory as the directory location, and if you have not installed any version of the SDK via the SDK Manager tool, it will alert you to install it immediately.
If Eclipse does not automatically associate the installation directory of the Android SDK, you can select Window-> Preferences in the Open eclipse, and you will see the Android Setup entry in the pop-up panel, and fill in the Installed SDK path. The platform package that you just installed in the SDK appears, and the configuration is finished by pressing OK.
Here, we're done with the development environment on Android on Windows, when you use Eclipse's file--"new--" Project ... When you create a new project, you'll see an option to build the Android project.
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.