Android SDK download, installation and configuration tutorial

December 07, 2017 13:33:32

Reprinted from: http://blog.csdn.net/dr_neo/article/details/49870587

Android development environment construction can be divided into the following four steps:

The first step is to install JDK;

The second step, install Eclipse;

The third step, download and install the Android SDK;

Step 4: Install the ADT plugin for Eclipse

 

Details are described below.

The first step, install JDK

Android development tools require that JDK (Java Development Kit) must be installed, not only JRE (Java Runtime Edition), but JavaJDK must be installed before installing Android development tools. In particular, the development process of Eclipse must be supported by JDK or JRE, otherwise an error will be reported when starting Eclipse:

 

First, go to the JAVA official website (http://www.oracle.com/technetwork/java/javase/downloads/index.html) to download the JDK (note that the JDK is downloaded, not the JRE),

 

After clicking the JDK download button, enter the JDK version selection interface, find the JDK version suitable for your computer system, and download it, as shown in the figure below, select Windows x86 for win32-bit systems, and Windows x64 for 64-bit systems:

 

After downloading, double-click to install:

 

Then choose the path you want to install:

 

When installing JDK, it will automatically install JRE for you, just select the path you want to install:

 

Then continue to the next step until the final installation is complete:

 

After installation, configure environment variables. Create a new system environment variable, the variable name is JAVA_HOME, and the variable value is the installation path of the JDK, as shown in the following figure:

 

Then in the list of system variables, double-click the Path variable, and append ;%JAVA_HOME%\bin; %JAVA_HOME%\jre\bin to the variable value (note that when adding at the end of the variable, remember to add a semicolon) :

 

The Oracle JDK is now part of the system executable search path, and the address is easy to find. To verify that the installation was successful, open a command line window and execute javac -version at the command prompt. If the installation is successful, you will see the Oracle JDK version number, as shown below:

 

 

The second step, install Eclipse

 

Go to the Eclipse official website (http://www.eclipse.org/downloads/) to download Eclipse, select EclipseIDE for JAVA EE Developers, and select the 32-bit or 64-bit installation package according to your own system.

 

After Eclipse is downloaded, it is a zip archive, which can be directly extracted to the folder you want to use without installing it yourself. The file directory is as follows:

 

After Eclipse is installed, double-click "eclipse.exe" to open it, as shown in the following figure:

 

 

Note that Eclipse is open at this point. The following errors may be reported:

 

The possible reason for this problem is that the JDK environment variable is not configured properly. Please configure it according to the JDK environment variable setting method mentioned in the first step. If it still reports an error, it may be that the environment variable is not set properly. In this case, we only need to restart the computer. If it still doesn't work, then you can modify the Eclipse.ini file and add two lines to the top:

-vm

D:\android\Java\jdk1.8.0_51\bin\javaw.exe (note, replace D:\android\Java\jdk1.8.0_51\ with your own jdk installation directory)

After some tossing through the above, now Eclipse can start smoothly!

After starting Eclipse, you will first be asked to select a workspace, just specify one yourself (the default is the workspace folder of the C drive):

 

Then enter the Eclipse welcome interface, as shown below:

 

At this point, the Eclipse installation is complete.

 

The third step, download and install the Android SDK

In the first two steps, we have configured the JDK variable environment and installed Eclipse. After these two steps, the Java development environment is ready. If we only develop ordinary JAVA applications, then we can go here. But if we want to develop Android applications through Eclipse, then we also need to download the Android SDK (Software Development Kit) and install the ADT plug-in on Eclipse.

First, download the Android SDK Tools, friends who have climbed the wall can go to the official website of Google Android to download (http://developer.android.com/sdk/index.html). Friends who are unwilling to FQ can go to my bd network disk to download (http://pan.baidu.com/s/1nt8BcBB), or go to this website to download (http://www.androiddevtools.cn/). Let's introduce the download on this website. First open http://www.androiddevtools.cn/ , we can see that there are various tools required for Android development, first find the SDK Tools:

 

Just choose the latest version. Note that there are two kinds of files, exe and zip, for download. The exe is an installer, and you need to double-click to install it. It is recommended to download the zip archive here. After downloading, unzip it directly to the path where you want to install Android. The decompressed file directory is as follows:

 

Then double-click "SDK Manager.exe" to start the SDK Manager, as shown in the figure:

 

When you see that there are so many to choose and install, are you a little dizzy and don't know what to do? . . Especially for someone with severe choice phobia like Neo, it really feels like their head is going to explode. . . At this time, you must keep calm.

Here I only mention a few that must be installed, as shown in the figure above, the Android SDK Tools in the Tools folder (this one we have downloaded in the previous step, generally will not let you install it again, but there are It may let you update), and then there are Android SDK Platform-tools and Android SDKBuild-tools, note that you only need to download the latest version.

Then there is the choice of API. We can see that there are many, many versions of API from Android 2.2 to Android 5.x, so how to choose. Here I suggest that if you are a novice, just choose the latest version, because Android is backward compatible. After the other you need to use it and download it (because the download and installation speed is too slow...). So as shown in the picture above, here I only choose to download the current latest Android 5.1.1 (API 22). What needs to be explained here is that if you don't plan to use the simulator to debug, but always use the real machine to debug, then you don't need to install "system images". However, if you are a novice and don't know how to choose, it is recommended to tick all of them directly.

Finally, there are things in the extras folder, as shown in the following figure,

 

Theoretically speaking, if the internet speed allows and there is plenty of time, everything in extras should be downloaded. It should be a good thing. However, at the beginning of the installation, you can only install the three in the above picture, namely Android Support Repository, Android SupportLibrary and Google USB Driver. The rest will be downloaded later when there is time.

Then you can install it. Be careful, because these things are downloaded on google's servers. Since there is a wall in our country, there may be a situation where the connection cannot be made, as shown in the following figure:

 

At this time, we can download and install through the domestic mirror server with Android SDK. Here are a few recommended:

1. The address of the mirror site of the Open Source Association of the Chinese Academy of Sciences:

IPV4/IPV6 :  http://mirrors.opencas.ac.cn  Port: 80

2. The mirror server address of Beijing University of Chemical Technology:

IPv4:  http://ubuntu.buct.edu.cn/Port   : 80

IPv4:  http://ubuntu.buct.cn/Port   : 80

IPv6:  http://ubuntu.buct6.edu.cn/Port   : 80

3. The mirror server address of Dalian Neusoft Institute of Information:

http://mirrors.neusoft.edu.cn   Port: 80

 

Just choose any one. Here I choose the third site, the mirror image of Dalian Neusoft. The usage method is as follows:

First, click "Tools" in the menu, then select "Options..." in the drop-down,

 

Then in the pop-up dialog box, fill in the HTTP Proxy Server as mirrors.neusoft.edu.cn (the address of the mirror server, be careful not to add http in front), and then fill in the HTTP Proxy Port as 80 (the port number). Finally, check the "Forcehttps://... sources to be fetched using http://..." checkbox below, as shown below

 

Then click close to close the dialog box, and then restart the SDK Manager.

After a long download and installation process (it is recommended to download at night...), we can see that the status behind the previously selected and installed items has changed from the previous "Not installed" to the current "Installed". It means that we have successfully installed! Are you excited? . ps. . Go brush your teeth and wash your face now. . I'm going to be late. . .

 

Since it is very long to use the SDK Manager to download and install online It's much faster, but you just need to pay attention to choosing the package you need to download and the corresponding version. I won't go into details here. You can leave a message for boron oil with a choice phobia.

 

Ok, then is the last step, we are familiar with setting environment variables. Here you need to append the "\platform-tools" and "\tools" paths to the system environment variable Path, as follows:

First, create a new system environment variable, the variable name is ANDROID_SDK_HOME, and the variable value is your SDK installation path. Here my installation path is D:\android\android-sdk, as shown in the figure:

 

Then, after the Path variable of the system, append ;% ANDROID_SDK_HOME%\platform-tools;% ANDROID_SDK_HOME%\tools, as shown in the figure:

 

Then we can check whether the Android SDK is installed successfully: enter "adb version" in the command line window, and the following display appears, then the installation is successful:

 

 

Step 4: Install the ADT plugin for Eclipse

Thanks for the great nose-picking Bryant! Finally come to the last step! In order to be able to develop Android on Eclipse, we must install an ADT (Android Development Tools) plug-in for him.

First open the Eclipse software. Enter the welcome screen. Click "Help" in the menu, select "Install New Software...", as shown below:

 

After clicking "Install New Software...", the "Install" window pops up, and then click the "Add" button,

 

Then the "Add Repository" window will pop up, enter the following information: Name (ADT), Location (http://dl-ssl.google.com/android/eclipse/), as shown in the figure below, and then click the "OK" button :

 

In the pop-up dialog box, select the tool to be installed, and then the next step is fine:

 

However, if we do not modify the hosts or use the proxy FQ, because ( http://dl-ssl.google.com/android/eclipse/ ) this website is not available in the sky, the following error will be reported:

 

In this case, we either choose to continue the online installation by modifying the hosts or using the proxy FQ, or adopt the offline installation method (recommended), see my other blog for details (http://blog.csdn .net/dr_neo/article/details/46941859)

After everything is installed, restart Eclipse. Then, Eclipse will intelligently associate with the Android sdk in the same directory according to the location of the directory. You can view it by selecting the menu item "Window" and clicking Preference, as shown in the figure:

 

Select "Android" in the sidebar, and if you can see the installed SDK platform, it means that it has been automatically associated, as shown in the figure below; if you find that it is not automatically associated, you need to add it yourself, click "Browse..." button, select your SDK installation path, and add it~

 

At this point, our entire Android development environment construction on windows is completed. At this time, in Eclipse, select the menu item File—>New—>Project to create a new project, and we can see the creation of the Android project. Options are:

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324611404&siteId=291194637