Five steps to the Android development environment deployment--Very detailed Android development environment Construction Tutorial (reprint)

Source: Internet
Author: User
Tags android sdk manager java se

IntroductionInstalling Android in Windows Development environment is not simple or complicated, this article for the first time I want to build Android development environment on their windows to put Android wave friends, in order to ensure that everyone can successfully complete the development environment, the article wrote as far as possible, Hope to be helpful to friends who are ready to enter Android development. This tutorial will be divided into five steps to complete the deployment of an Android development environment. First step: Install the 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 plugin for Eclipse.
First step: Install the JDK
To download the Oracle Company's JDK, Baidu "JDK" can enter the Oracle company 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 your local computer, double-click to install. After the JDK default installation succeeds, two folders appear in the system directory, one for the JDK and one for the JRE. The full name of the JDK is the Java SE Development Kit, the Java Development Toolkit. SE represents the Standard Edition. The JDK is the core of Java, containing the Java runtime (Java Runtime Environment), a stack of Java tools, and a Java class library that is called when developers develop applications. We can open the Bin directory under the JDK's installation directory, which has many executable programs with suffixes named EXE, which are the tools that the JDK contains.  In the second step of configuring the JDK's variable environment, we can easily invoke these tools and their commands. The JDK includes the following basic tools: The Javac:java compiler, which converts the source code into bytecode. Jar: Package tool to package related class files into one file. Javadoc: Document generator, extracting documents from source notes. Jdb:debugger, debug the error-checking tool. Java: Run the compiled Java program. Step Two: Configure the variable environment for the JDK on Windows  Many of those who have just learned Java development follow the online tutorials to easily configure a variable environment for the JDK on Windows, but why not think so much about configuring it.   We usually open an application, usually by double-clicking the application icon on the desktop or clicking the menu link of the application in the System Start menu, whether the shortcut icon for the desktop or the menu link contains the installation location information for the application. When you open them, the system will follow these location information to locate the installation directory and start the program.    know the installation directory location of an application, we can also open through the command line tool, such as the location of QQ: C:\Program Files (x86) \tencent\qq\qqprotect\bin, QQ app name is QQProtect.exe, then we open the command line tool, then go to "C:\Program Files (x86) \tencent\qq\qqprotect\bin" directory, and then enter "Qqprotect", You can run QQ.    if we want to open the command line tool, the direct input "Qqprotect" can start the QQ program, not every time into the QQ installation directory and then start, this time can be configured by the system environment variable path to achieve. Right click on "My Computer", select "Properties", in the open window click on the left "advanced system Settings", the "System Properties" window, under the "Advanced" tab, click "Environment variables".    Edit the system variable name "path" and append the installation directory of QQ after the "path" variable (string content):; C:\Program Files (x86) \tencent\qq\qqprotect\bin Note that when appending, add a semicolon in front of the directory string, and the semicolon is used to distinguish between paths in the path.    OK after saving, then go back to the command window, no matter in any directory, you just enter the Qqprotect command, QQ will start.    by starting the QQ example, we summarize: when the system is required to start an application, the system will first look in the current directory, if not the path specified in the system variable paths to find. We said earlier that the JDK contains a bunch of development tools that are located in the JDK's installation directory, and in order to facilitate the use of these development tools, it is necessary to set the installation directory of the JDK to the system variables. This is why you need to set the bin directory of the JDK as a system environment variable after installing the JDK in Windows.   In order to configure the JDK's system variable environment, we need to set up three system variables, namely JAVA_home,path and Classpath. Here are the three variables that are set to guard against.   Java_homeSet the system variable name first, and the variable value is the JDK's installation path on your computer: 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. PathThe Path property already exists, can be edited directly, appended with the original variable:;%java_home%\bin;%java_home%\jre\bin. CLASSPATHSet the system variable name to: CLASSPATH variable value is:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar. Note the variable value string is preceded by a "." Represents the current directory, the purpose of setting up classpath is to tell the Java execution Environment, in which directories you can find the classes or packages that you need to execute the Java program. step three: Download and install EclipseEclipse is an IDE (integrated development environment) developed for Java applications and Android. Eclipse does not need to be installed, after the download unzip the package, cut the Eclipse folder to the place where you want to install, open when you set up your working directory. There are multiple versions of Eclipse, and here you choose to download the Eclipse IDE for Java EE developers version. Fourth Step: Download and install the Android SDKWith the JDK variable environment configured and eclipse installed, the Java development environment is ready if you are just developing a common 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 to associate. 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 Android developer Tools integrated with Eclipse,  Because we have already downloaded eclipse this time, we chose to download the Android SDK separately. After downloading, double-click Install, specify the Android SDK installation directory, in order to facilitate the use of the Android SDK contains the development tools, we in the system environment variable path set the Android SDK installation directory under the Tools directory. In the Android SDK installation directory, double-click "SDK Manager.exe" to open the Android SDK Manager,android SDK Manage is responsible for downloading or updating different versions of the SDK package, we see the default installed Android SDK  The manager installs only one version of SDK tools.  Open the Android SDK Manager, which will get an installable version of the SDK, but there are walls in the country, sometimes there will be a failure to obtain. From the log window that pops up, we can see that the connection "https://dl-ssl.google.com" failed.  We ping the command, found that the network does not pass. From the universal Internet, we have found a solution to this problem, but also effective. Change the host fileFirst 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 hosts file at the end, save. If your WINDOWS8 system may not have permission to modify the host file, you can right-click the Hosts file and set the Users group to a permission that can be fully controlled by the hosts file. 203.208.46.146 dl.google.com203.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. change the HTTPS request on the Android SDK manage to an HTTP requestOpen the Android SDK Manager, in the Options under Tools, there is a force https://..sources to be fetched using http://.  Check this one out and you can. Then open the Android SDK Manager.exe, you can normally download the various versions of Android SDK. You only need to select the installation package you want to install or update. This is a more time-consuming process, and there will be a failure to download, and the failed installation package will only need to be re-selected before it can be installed. If you can not download the Android SDK by changing DNS, there are two methods, the first one is to own a ladder fq, the second is downloaded from this site, the download address is: http://www.androiddevtools.cn/ Fifth Step: Install the ADT plugin for EclipseWe have already configured the Java Development environment, installed the IDE to develop Android, downloaded the Android SDK, but Eclipse has not been associated with the Android SDK, that is, they are now independent of each other, like a gun and bullets separated. To make Android apps easier to create, run, and debug, Android's development team specifically 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 Add in the popup dialog box ... Button.  Then enter in the location in the popup dialog: Http://dl-ssl.google.com/android/eclipse/,Name can enter ADT and click "OK" button.  In the dialog box that pops up, select the tool you want to install, and the next step is ready.  After installation, you will be asked to restart Eclipse,eclipse will intelligently associate it with the Android SDK in the same directory according to the directory location, and if you have not installed any version of Android SDK through the SDK Manager tool, it will alert you to install them immediately. If eclipse does not automatically correlate the installation directory of the Android SDK, you can select Windows---Preferences in the open eclipse, and you will see the Android settings in the popup panel, filling in the installed SDK path,  The platform packages that you just installed in the SDK will appear, and you can complete the configuration by pressing OK. Here, we build on the Android development environment on Windows, when you use Eclipse's file--"new--" Project ... When you create a new project, you'll see the option to build an Android project.

Five steps to the Android development environment deployment--Very detailed Android development environment Construction Tutorial (reprint)

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.