Http://www.cnblogs.com/allenzheng/archive/2012/11/10/2762379.htmlAndroid Foundation uses Eclipse to build the Android development environment and create the first Android project (Windows platform)
First, build the Android development environment
Getting ready: Download Eclipse, JDK, Android SDK, ADT Plugin
: eclipse:http://www.eclipse.org/downloads/
Jdk:http://www.oracle.com/technetwork/java/javase/downloads/jdk7u9-downloads-1859576.html
Android sdk:http://developer.android.com/sdk/index.html
Adt:http://developer.android.com/tools/sdk/eclipse-adt.html
1. Install and configure the Java Development environment:
① install the prepared Eclipse and JDK on this machine (preferably installed in a full English path) and configure environment variables for the JDK, where the JDK's variable value is the root directory of the JDK installation path, as mine is: D:\Program files\java\jdk1.7.0_02;
② Open a command prompt (cmd) and enter the Java-version command, indicating that the Java environment variable is already configured.
2. Install ADT Plugin:
① Open the installed Eclipse, select "Help" on the menu bar, click "Install new software ..." in the pop-up drop-down box.
② in the newly opened dialog we can simply enter in "Work with": https://dl-ssl.google.com/android/eclipse/to install the ADT plugin online, but because Google's servers are built abroad, So the installation will be slow in this way, and may appear in the case of poor personality, so it is not recommended to install online.
③ I recommend installing directly from the downloaded ADT Plug-in package (this can be done in an offline environment). The steps are: Click on the "Add" button in the newly opened dialog box and click "Archive" button in the Open dialog box to select the ADT plugin compression package that was saved on the local hard drive, as the "Name" above can be arbitrarily taken, this is just a code name, no practical effect.
④ Click "OK" button in the previous step, we will find that there are two lines in the middle of the check box, click the "Select All" button to select all the checkboxes, this step after the "Next", the need to "accept" to select "Accept", until the end of the click "Finish", This allows the ADT plug-in to be installed. The time required for the entire process depends on the performance of the machine. After installing the ADT plugin, the Eclipse toolbar will appear with a row of Android icons, such as:
3. Install the SDK:
① installs the downloaded Android SDK on this machine (preferably installed in a full English path) and configures the environment variables for the Android SDK. The environment variable value for the Android SDK is the directory path for the Platform-tools folder and tools file folders under the SDK installation directory, as in my case: E:\My studying\android\android-sdk\ Platform-tools, E:\My studying\android\android-sdk\tools, in the variable value, two paths are separated by commas.
② Open a command prompt (cmd), enter the android-h and ADB commands separately, and show that the Android SDK environment variables are already configured.
③ Open the installation directory for the Android SDK, double-click SDK Manager, and in the open window, select the SDK version you need to install, where "Status" indicates whether the SDK package is installed, as I chose "Android2.2 (API 8)" (I have already installed, so "Status" is "Installed") and then click on the "Install packages ..." button, in the pop-up window, it is best to select "Accept all" so that you can install all the packages you just selected The last point "Install" button will start the installation, the whole process will be very slow, which requires your patience.
We can also open the SDK Manager by clicking on the icon in the tool bar on Eclipse and install it, which is not as tiring as the SDK installation method above.
④ finally Select "Windows" on the Eclipes main menu and select "Preferrnces";
⑤ in the Pop-up dialog box, select "Android" in the left-hand column, and click on the "Browse ..." button on the right to choose the installation path root directory of the SDK, tap the bottom "OK" button, so the SDK is loaded successfully on eclipse.
4. Create an android Emulator (AVD):
① Open eclipse-> Click on the icon on the Eclipse toolbar to open the Android Virsual Device Manager window;
② in the "Android Virsual Device Manager" window, click the "New" button, and in the pop-up window "Name" can be arbitrarily taken; "Target" means the system version of the simulator; "Size" of the SD card , as long as you do not have too many applications in the simulator, generally give a twenty or thirty MB is enough; "Skin" refers to the screen resolution size, where "Built in" is the average phone standard screen resolution size, and "Resolution" is the custom screen resolution size, specific practices, Can be selected according to their own circumstances. All set up and click on "Create AVD" when a simulator is created. If necessary, we can create multiple emulators to use when testing.
Attached: The Android simulator model and its corresponding resolution size:
Standard |
Width |
|
Height |
DAR |
Pixeis |
HVGA |
480 |
* |
320 |
3:2 |
153,600 |
QVGA |
320 |
* |
240 |
4:3 |
76,800 |
WQVGA400 |
400 |
* |
240 |
5:3 |
96,000 |
WQVGA432 |
432 |
* |
240 |
9:5 |
103,680 |
WVGA800 |
800 |
* |
480 |
5:3 |
384,000 |
WVGA852 |
854 |
* |
480 |
|
409,920 |
So far, the Android development environment has been successfully built on eclipse, so let's look at how to create a new first Android project.
Second, a new Android project
① open Eclipse, click "File" in the menu bar and move the mouse cursor to "New" in the pop-up list box, if you can see the "Android applicaion Project" option directly, Click this option directly, otherwise select the bottom "other ...", in the pop-up window, expand the "Android" item, select "Android applicaion Project", and then "Next";
One way to do this is to point directly to the Eclipse toolbar as indicated by the icon:
② in the new pop-up window to fill in the relevant information, all the way "Next", until you click "Finish", so that the first Android program is created, this is you will find eclipse left a new Android project you created.
Third, build Android project
Right-click the item as shown, select "Run as" in the pop-up list box, click "Android Application", and you will see that the simulator starts automatically and when the emulator is fully booted, you will be able to view the project's compilation results. Have you seen something that looks familiar? In fact, that's what you did when you created the project, and start your Android journey.
If any of the above is inappropriate, welcome to shoot Bricks!
Android Eclipse Environment Build (reprint)