Build an android Development Environment
When writing this article, the latest Android SDK version is 2.1. Now let's take a look at how to build an android 2.1 Development Environment on the Windows platform.
The software package to be downloaded in advance is as follows:
1. JDK 1.6 +
2. Android sdks 1.6
3. Android SDK setup
4. Eclipse IDE for Java developers
When you see this, you may be anxious to ask: "Isn't it necessary to build an android 2.1 Development Environment? How can I download Android SDK 1.6 instead of 2.1 ?"
That's right. It's about how to build the android 2.1 development environment. However, after several attempts, I found that there was a problem with directly downloading and installing Android SDK 2.0 and 2.1. What's the problem? To put it simply, the two latest sdks do not include the adb.exe file, and the android SDK location cannot be specified in eclipse (that is, it cannot be developed using eclipse ). Therefore, this has taken the path of saving the nation. Maybe, as my own attempt has proved, Android SDK 2.0 and 2.1 are actually upgrade packages, rather than the complete development packages. After comparison, the sizes of Android SDK 2.0 and 2.1 are 77.3 MB and 1.6 Mb respectively, while the size of Android SDK 248 is MB, which is quite different, this seems to prove my judgment. However, in any case, download Android SDK 1.6 first, and then download and update Android SDK 2.0 and 2.1 through the ADT (Android Developer Tools, Android developer tools) and Android SDK setup program, yes.
Let's talk less and get down to the truth.
First, access http://java.sun.com/javase/downloads/widget/jdk6.jsp
Download Java SE Development Kit 6u20(jdk-6u20-windows-i586.exe)
The file size is 76.67 MB.
Second, access http://dl.google.com/android/archives/android-sdk-windows-1.6_r1.zip
Download Android SDK 1.6(android-sdk-windows-1.6_r1.zip)
The file size is 248 MB.
Then, access http://dl.google.com/android/android-sdk_r04-windows.zip
Download Android SDK setup(android-sdk_r04-windows.zip)
The file size is 22 MB.
Finally, access http://www.eclipse.org/downloads/
Download Eclipse IDE for Java developers(eclipse-java-galileo-sr2-win32.zip)
The file size is 92.7 MB.
After the download is complete, start installation and configuration.
Step 1: install and configure JDK.
After the download, run jdk-6u20-windows-i586.exe in double mode. If you select to install jdk-6u20-windows-i586.exe in the C:/Java/jdk1.6.0 _ 20 directory (of course, there is no problem when installing it in the default path ). After installation, configure the environment variables. The procedure is as follows:
(1) set the Java path
Right-click "my computer", select "properties", open the "System Properties" dialog box, click the "advanced" tab, and click "environment variables, in the displayed dialog box, click "new" under "system variables", enter java_home in "variable name", and enter C in "variable value: /Java/jdk1.6.0 _ 20, click "OK ".
(2) set the class path
Create a system variable, enter classpath in the variable name, and enter.; % java_home %/LIB; % java_home %/lib/tools. jar in the variable value.
Note: The. (DOT) in the first.; indicates the current path, and the (semicolon) indicates the path separator. The following % java_home % references the previously created Java installation path.
(3) set the path
Generally, PATH variables are available. Select "edit" and add "% java_home %/bin" after "variable value". % java_home %/JRE/bin, pay attention to the semicolon.
In this way, JDK is installed. "Start-> Run", Enter cmd, and enter "Java-version" in the command line prompt. the Java version "1.6.0 _ 20" information should be displayed. JDK is successfully installed.
Step 2: decompress and configure Android SDK 1.6
Decompress the downloaded android-sdk-windows-1.6_r1.zip file to the C:/android-sdk-windows-1.6_r1 directory (which directory does not work ). Then, configure the environment variable. The procedure is as follows:
(1) set the android path
Repeat Step 1 (1), create a new "system variable", enter android_home in the variable name (case-insensitive), and add C:/android-sdk-windows-1.6_r1 to the variable value.
(2) set the path
"Edit" PATH variable, and add % android_home %/tools after "variable value". Pay attention to the semicolon before.
In this way, Android SDK 1.6 is installed. "Start-> Run", Enter cmd, and enter "Android-help" in the command line prompt. The help information should be displayed. Android SDK 1.6 is successfully installed.
Step 3: Decompress eclipse, associate Android SDK, and install ADT
Decompress the downloaded eclipse-java-galileo-sr2-win32.zip file to C:/eclipse. then, double-click eclipse.exe to start eclipse.
Install ADT: menu "Help-> install new software ...", Open the install dialog box and click Add... Click Add site, enter ADT in name, and enter https://dl-ssl.google.com/android/eclipse/in location /. Then download and install ADT.
Associate with adnroid SDK: menu "Windows-> Preferences". Open the preferences dialog box and click Android. In the android reference on the right, Click Browse… on the right of the SDK location text box... Button, find C:/android-sdk-windows-1.6_r1, OK ".
(If you do not upgrade the android SDK, 1.5 or 1.6 is acceptable)
Step 4: Decompress Android SDK setup and download and update Android SDK 2.0 and 2.1
Decompress the downloaded android-sdk_r04-windows.zip file to C:/Android-SDK-Windows, enter the folder, double-click SDK setup.exe, start Android SDK and AVD manager, and select the settings item on the left, then select force https: //… In the right-side pane ://... Sources to be fetched using http: //, and then select Save & apply. Then, see the illustration here:
How to Use Android SDK setup? Http://www.android123.com.cn/zhongwensdk/366.html
I have selected all the content to be updated, including:
* Android SDK tools, Revision 5
* Documentation for Android SDK, API 7, Revision 1
* SDK platform Android 2.1, API 7 Revision 1
* Sapmles for sdk api 7, Revision 1
* SDK platform Android 2.0.1, API 6, Revision 1
Wait patiently -- Note that if there is a prompt during the update process, it may be because you are using the C:/android-sdk-windows-1.6_r1 directory, or anti-virus software does not allow rewriting of files in it, in this case, You need to exit all programs or temporarily disable anti-virus software.
If everything goes well, the android 2.1 Development Environment (or the Android 1.6, 2.0, and 2.1 development environments) will be ready.