The reason for writing this series is that you are more interested in android, and most tutorials on the Internet are directly referred to official translations, and the translation quality is not very good, because something is really understandable in English, Chinese translation is not uncommon.
I am not saying how good I am in English, so I will not translate. I will only record my learning progress and share it with you.
Then I will start with the most basic environment configuration.
I. Android Development Environment Configuration
1.1Android development environment requirements
1.1.1 Operating System
Currently, only XP (32-bit), Vista (32/64-bit), Mac OS X 10.4.8, or later versions (x86), and Linux (only tested on Linux Ubuntu Dapper Drake) are supported ).
My notes are based on my system XP sp2/sp3 32bit. Other System friends can google the differences, which are similar in any case.
1.1.2 Android Development Environment
We recommend that you use eclipse for development, whether on the official website or myself. Of course, the eclipse version must be later than 3.3. This is an official statement. I have not tested the version below 3.3, or 3.3 (Europa), 3.4 (Ganymede) can be used, java or EE version is no problem, you can go to the eclipse official download the latest version.
Because development is based on java, jdk is indispensable. jdk requires 5.0 or 6.0. I still use more than 5.0, which can be officially downloaded from sun.
If you do not need eclipse, you can also directly use ant to build it. Of course you need ant. I will introduce ant configuration. Generally, ant users already know it, new users will not use it. eclipse is certainly used.
1.2 Android development environment variable configuration
1.2.1 jdk Configuration
If you have already configured it, please move over ...... Experts float ......
Follow up for new users.
First download the jdk from the sun official website. Note that jdk is not jre, Because jre provides a java Runtime Environment instead of a development environment. Sun http://java.sun.com
After downloading and installing the package or some friends are downloading the package, decompress it to a directory. For example, I am C: \ Program Files \ Java \ jdk1.5.0 _ 14.
Right-click my computer-> properties-> advanced, click the environment variables below, and in the "System variables" area below, select create and enter JAVA_HOME in the variable name, enter the directory in the variable value. For example, my file is C: \ Program Files \ Java \ jdk1.5.0 _ 14. Then, create a new variable named classpath with the variable value .; % JAVA_HOME %/lib/rt. jar; % JAVA_HOME %/lib/tools. jar, find the PATH variable, double-click or click Edit, and add % JAVA_HOME %/bin at the beginning of the variable value. Pay attention to the content. OK, OK, and OK.
Then start-run cmd, enter java or javac to see if there is any effect. If there are a lot of stuff, then OK, if xxx is not an internal or external command, it indicates that there is a problem with the settings.
1.2.2 download and install eclipse
To eclipse official download the latest version, http://www.eclipse.org/downloads/ I just got the latest 189m's eclipse-jee-galileo-win32.zip you can choose to download, download and unzip to run. No other special configuration is required ".
1.2.3 sdk Configuration
Because we want to develop the android Application, so the next sdk is Google download, address in the http://developer.android.com/sdk/1.5_r3/index.html after updating the estimated address will change, so you can. Download and decompress to a directory, such as my D: \ SDK \ android-sdk-windows-1.5_r3 \ android-sdk-windows-1.5_r3 and then the same to set the environment variables, the same jdk settings, create a new SDK_HOME, the value is D: \ SDK \ android-sdk-windows-1.5_r3 \ android-sdk-windows-1.5_r3, and then find the path, add % SDK_HOME % \ tools; in front of OK.
Like jdk, we can also test whether the environment variables are set successfully. In the cmd window, enter android and a bunch of things will appear. OK is complete.
1.2.4 ant Configuration
I can't use eclipse for development. However, some "experts" just like it. Haha, ant is apache stuff. So download it from ant.apache.org and decompress it after you get down, configure the environment variable ANT_HOME = add % ANT_HOME %/bin to the decompressed path;
Similarly, if you enter ant in cmd, It will be OK if the build. xml prompt does not exist.
1.3 eclipse settings
Of course, after all the above steps are completed, you cannot use eclipse to develop android applications immediately. You must add the eclipse plug-in. Fortunately, this step is very easy. After opening eclipse, click help-> install new software... then, click "Add" to display a window for adding Site. Here, enter "Name" in android (you can retrieve it yourself) and enter the network address of the plug-in "location:
Https://dl-ssl.google.com/android/eclipse/
Then, wait for the connection. Then, install and select "Android DDMS" and "Android Development Tools", and finish the task. It may take some time to calculate the resource usage of the plug-in, wait. After completion, you will be prompted to restart eclipse to load the plug-in. OK, restart, and you will be able to use it.
1.4 final steps for configuring the Android development environment ......
The reason for this is that "Failed to find an AVD compatible with target" is always displayed when I run example. So let's write this step to remind everyone.
Avd must be created before running the instance. You can directly enter the android list in cmd to list the APIs that can be used to create avd. Here I have id1 id2 id3 corresponding to sdk1.1 sdk1.5 GoogleAPIs.
Then run android create -- name myname (take your own name, er in English) -- target 3 (if you want to use sdk1.5, enter 2 and 1.1, use 1)
After the creation, the ultimate step is completed ......
Now, you can go to eclipse to create an android project, and right-click the project and choose run -- run android. However, the simulator started on for a long time, causing me to fail at first, I 've been stuck on android, but it's actually starting ...... Then, you can play games first. You can't afford to buy a mobile phone, or you can use a simulator ......
In addition, before creating an android project in eclipse, You need to configure the sdk directory in eclipse. Note that it is not the tools directory. Method: window -- preferences -- android: Enter the SDK directory address in sdk location, or click browse to locate the sdk directory. Then, apply and OK.