Android Basics with Eclipse build Android development environment and create first Android project (Windows platform)

Source: Internet
Author: User

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 * 3:2 153,600
QVGA - * + 4:3 76,800
WQVGA400 + * + 5:3 96,000
WQVGA432 432 * 9:5 103,680
WVGA800 + * 480 5:3 384,000
WVGA852 8 The * 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" on 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, 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.

Http://www.cnblogs.com/allenzheng/archive/2012/11/10/2762379.html

Android Basics with Eclipse build Android development environment and create first Android project (Windows platform)

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.