Install and configure the Android project in Eclipse development, eclipseandroid

Source: Internet
Author: User

Install and configure the Android project in Eclipse development, eclipseandroid
The development environment for installing Android on windows is neither simple nor complex. This article is written to my friends who want to invest in the Android development environment on their Windows for the first time, to ensure that the development environment can be successfully established, the article should be as detailed as possible, hoping to help those who are preparing for Android development. This tutorial consists of five steps to deploy the Android development environment. Step 1: Install JDK. Step 2: configure the JDK variable environment on Windows. Step 3: download and install Eclipse. Step 4: download and install the Android SDK. Step 5: Install the ADT plug-in for Eclipse.Step 1: Install JDKTo download the JDK Oracle company can Baidu "JDK" to enter the JDK Oracle company download page (the current download page address for the http://www.oracle.com/technetwork/java/javase/downloads/index.html), select the corresponding version of your computer system. Download it to your local computer and double-click it to install it. After JDK is installed successfully by default, two folders are displayed in the system directory, one representing jdk and the other representing jre. The full name of JDK is Java SE Development Kit, which is the Java Development Toolkit. SE indicates the Standard Edition. JDK is the core of Java, including the Java Runtime Environment (Java Runtime Environment), a bunch of Java tools and Java class libraries called when developers develop applications. We can open the Bin directory under the jdk installation directory, which contains many executable programs with the extension name exe. These tools are included in JDK. By configuring the JDK variable environment described in step 2, we can conveniently call these tools and their commands. JDK includes the following basic tools: javac: Java compiler, which converts source code into bytecode. Jar: a packaging tool that packs related class files into one file. Javadoc: Document builder, which extracts documents from source code comments. Jdb: debugger. debug the error checking tool. Java: run the compiled java program.Step 2: configure the JDK variable environment on Windows Many people who have just developed java can easily configure the JDK variable environment on Windows according to the online tutorial, but they do not think much about this configuration. We usually open an application by double-clicking the application icon on the desktop or clicking the application menu link in the system start menu, both the desktop shortcut icons and menu links contain the installation location information of the application. When you open them, the system will find the installation directory based on the Location Information and start the program. Once you know the installation directory location of an application, you can use the command line tool to open it. For example, the QQ location is: C: \ Program Files (x86) \ Tencent \ QQ \ QQProtect \ bin, and the QQ Application name is qqprotect.exe. Open the command line tool and go to the "C: \ Program Files (x86) \ Tencent \ QQ \ QQProtect \ Bin" directory, enter "QQProtect" to run qq. If you want to open the command line tool, directly enter "QQProtect" to start the qq program, instead of entering the qq installation directory every time, in this case, you can configure the Path of the system environment variable. Right-click "my computer" and select "properties". In the displayed window, click "Advanced System settings" on the left. The "System Properties" window appears, under the "advanced" tab, click "environment variables ". 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 an English semicolon should be added before the directory string when appending; the English Semicolon is used to distinguish different paths in the Path. After you are sure to save it, return to the Command window. No matter in any directory, you only need to enter the qqprotect command and qq will start. Through the example of starting qq, We will summarize: when the system is required to start an application, the system will first find it in the current directory, if not, search in the Path specified by the system variable Path. We mentioned earlier that JDK contains a bunch of development tools, all of which are under the JDK installation directory. To facilitate the use of these development tools, it is necessary to set the system variables in the JDK installation directory. This is why the bin directory of JDK needs to be set as the system environment variable after JDK is installed in Windows. To configure the JDK system variable environment, we need to set three system variables: JAVA_HOME, Path, and CLASSPATH. The following describes how to set and prevent the three variables.JAVA_HOMESet the system variable name to JDK installation path on your computer: C: \ Program Files \ Java \ jdk1.8.0 _ 20. After creation, you can use % JAVA_HOME % as the uniform reference path of the JDK installation directory.PathThe PATH attribute already exists and can be edited directly. It is appended to the original variable:; % JAVA_HOME % \ bin; % JAVA_HOME % \ jre \ bin.CLASSPATHSet the system variable name to: CLASSPATH. The variable value is:.; % JAVA_HOME % \ lib \ dt. jar; % JAVA_HOME % \ lib \ tools. jar. Note that there is ". "indicates the current directory. The purpose of setting CLASSPATH is to tell the Java execution environment which directories can find the classes or packages required for the Java program to be executed.Step 3: download and install EclipseEclipse is an IDE developed for Java applications and Android (integrated development environment ). Eclipse does not need to be installed. After downloading it, decompress the decompressed package, cut the eclipse folder to the place you want to install, and set your working directory when you open it. There are multiple versions of Eclipse. Here you can download the Eclipse IDE for Java EE Developers version.Step 4: download and install the Android SDKAfter the JDK variable environment is configured and Eclipse is installed, if only common JAVA applications are developed, the Java development environment is ready. To develop Android applications through Eclipse, We need to download the Android SDK (Software Development Kit) and install the ADT plug-in Eclipse. This plug-in can associate Eclipse with the Android SDK. The Android SDK provides the API library required for developing Android applications and the development tools required for building, testing, and debugging Android applications. Open http://developer.android.com/sdk/index.html and we will find that Google has integrated eclipse's Android Developer Tools. Because we have downloaded Eclipse this time, we choose to download the Android SDK separately. Download and double-click Install to specify the Android SDK installation directory. To facilitate the use of the development tools included in the Android SDK, we set the tools directory under the installation directory of the Android SDK in the Path in the system environment variable. In the installation directory of the Android SDK, double-click "SDK Manager.exe" to open the Android SDK Manager. The Android SDK Manage is responsible for downloading or updating SDK packages of different versions, we can see that only one version of SDK tools is installed in the default Android sdk Manager. Open Android SDK Manager and it will get the sdk version that can be installed, but there is a wall in China, sometimes the acquisition may fail. From the pop-up log window, we can see the connection https://dl-ssl.google.com failed. Through the ping command, we found that the Network was disconnected. From the omnipotent Internet, we have found a solution to this problem, which is also effective.Change the host fileFirst, change the host file. The host file is in the C: \ Windows \ System32 \ drivers \ etc directory. Open the "hosts" file in notepad and append the following two lines to the end of the hosts file, save it. If you have no permission to modify the host file in Windows 8, right-click the hosts file and set the Users Group to have full control over the hosts file. 203.208.46.146 dl. google. com203.208.46.146 the two lines above the dl-ssl.google.com are placed on the host file, which means to direct local access to dl.google.com and dl-ssl.google.com to the server with the IP address 203.208.46.146.If this method still does not work, we recommend that you use the Blue Lantern, which is quite fast. Change the https request on the Android SDK Manage to an http requestOpen the Android SDK Manager, in Options under Tools, there is a Force https://..sources to be fetched using http: //... check this one, you can. Then open the Android SDK Manager.exe. Under normal circumstances, you can download the sdks of various Android versions. You only need to select the installation package to be installed or updated. This is a time-consuming process, and the download may fail. The failed installation package only needs to be re-selected and then installed.If you cannot download the Android SDK by changing DNS, there are two ways, the first is to bring your own ladder FQ, the second is to download from this site, the download address is: http://www.androiddevtools.cn/ Step 5: Install the ADT plug-in for EclipseWe have already configured the java development environment, installed the Android IDE, downloaded and installed the Android SDK, but Eclipse has not been associated with the Android SDK, that is, they are now independent of each other, just like guns and bullets are separated. To facilitate the creation, running, and debugging of Android applications, the Android Development team has customized a plug-in for Eclipse IDE: Android Development Tools (ADT ). The following describes how to Install ADT online: Start Eclipse, click the Help menu-> Install New Software... ?, Click Add… in the pop-up dialog box... Button. Then, in the pop-up dialog box, enter http://dl-ssl.google.com/android/eclipse/. you can enter adtname and click “OK .pdf to press the button. In the pop-up dialog box, select the tool to be installed, and then click Next. After installation, you are required to restart Eclipse. Eclipse intelligently associates with the Android sdk in the same directory based on the directory location, if you have not installed any Android sdk version through the sdk manager tool, it will remind you to install them immediately. If Eclipse is not automatically associated with the installation directory of the Android sdk, you can choose Window> Preferences in Eclipse, and the Android settings will be displayed in the pop-up panel, fill in the path of the installed SDK, and the packages of the platform just installed in the SDK will appear. Click OK to complete the configuration. Here, we have built the development environment on Android on windows. At this time, you use the Eclipse File -- "New --" Project... when creating a new project, you will see the options for creating an Android project.

 

Author: Write and sing

Article Source: http://www.cnblogs.com/zoupeiyang

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.