A Preliminary Study on setting up a diary and an embedded android development environment in the Android Development Environment

Source: Internet
Author: User
Tags android sdk manager

A Preliminary Study on setting up a diary and an embedded android development environment in the Android Development Environment
Thank you very much. According to your blog, Baidu and Google have gradually established an android development environment. Just back up and view it for yourself. You can ignore this article. Most of the reference in this article: http://www.cnblogs.com/zoupeiyang/p/4034517.html, added the problems I encountered when building and their own solutions, also basically backed up my own settings at that time, for future viewing. 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 6: test whether the android development environment is set up successfully. Step 7: test whether the embedded settings and Android mobile devices can communicate with windows.Step 1: Install JDK
To 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 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. When the system is required to start an application, the system first searches in the current directory. If not, it searches 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. After java is installed, the path C: \ ProgramData \ Oracle \ Java \ javapath is automatically added to the path system environment variable, which is the default value. 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. (But I chose Eclipse IDE for Java Developers, which should be the same): http://www.eclipse.org/downloads/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,Android Studio is integrated with Eclipse, you can choose to download this, because I want to be familiar with Eclipse, so choose to download 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.Questions about invalid https://dl-ssl.google.com,Previously the old method is not feasible (modify the host to add two lines 203.208.46.146 dl.google.com 2 03.208.46.146 dl-ssl.google.com)I personally suggest that you use Baidu to solve this problem and select the search records for the last two weeks or a month. You should be able to meet and solve your problem. However, I still recommend some solutions as shown in the following example:1. in the "Android SDK Manager-Settings" window, enter mirrors.neusoft.edu.cn and 80 in the "HTTP Proxy Server" and "HTTP Proxy Port" input boxes, and select "Force https: //... sources to be fetched using http ://... "check box; 4. click Close to Close the Android SDK Manager-Settings window. 2. visit http://tool.chinaz.com/Webmaster tools site, choose super PING, dl-ssl.google.com paste up, this time you can see there are several can PING through the IP address, select the shortest time (35ms ~) Run cmd to ping the IP address, for example, 203.208.46.XXX, and add the IP address to the host according to the old method. 3. At present it seems that the domestic can access the dl-ssl.google.com web site, so some of the latest package may not need to deal with it, so flexible processing, combined with a variety of methods to download it! 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. Set system environment variablesANDROID_SDK_HOMESet the system variable name. The variable value is Android SDK installation path: D: \ Software \ Android \ android-sdk. After creation, you can use % ANDROID_SDK_HOME % as the uniform reference path of the JDK installation directory. PathAppend the existing variables; % ANDROID_SDK_HOME % \ tools; % ANDROID_SDK_HOME % \ platform-tools. If all the environment variables are set, run the following command on the terminal: java-versionandroid-hadb. If information is output, the environment variable is successfully set!

Step 7: communication between embedded devices and windows

Create a project and set

Connect to the android phone or embedded settings, and run as android application. The following message is displayed:

Step 6: test whether the Android system is successfully built

To create an Android project using Eclipse, follow these steps:

  

By default, all the way down, the simulator
Author: chsry Source: www.cnblogs.com/chsry :2015-08-18this blog article. You can refer to the source for personal development.

 

  

  

 

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.