Android Environment Setup

Source: Internet
Author: User

Android Basics with Eclipse build Android development environment and create 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;

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012110921105756.jpg "width=" 404 "height=" 470 "style=" Border:0px;margin-right:auto;margin-left:auto; "/>

② Open a command prompt (cmd) and enter the Java-version command, indicating that the Java environment variable is already configured.

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012110921532117.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

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.

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012110919583571.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

② 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.

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012110920160370.jpg "width=" 654 "height=" 604 "style=" border:0px;margin-right:auto;margin-left:auto; "/>

④ 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:

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012110920260879.jpg "width=" 670 "height=" 665 "style=" Border:0px;margin-right:auto;margin-left:auto; "/>

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012110920360393.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

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.

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012110921132921.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

② Open a command prompt (cmd), enter the android-h and ADB commands separately, and show that the Android SDK environment variables are already configured.

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012111116135055.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012110921524626.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

③ 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.

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012111012210067.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

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.

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012111014521726.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

④ finally Select "Windows" on the Eclipes main menu and select "Preferrnces";

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012110921302431.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

⑤ 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.

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012110921372521.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

4. Create an android Emulator (AVD):

① Open eclipse-> Click on the icon on the Eclipse toolbar to open the Android Virsual Device Manager window;

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012111014513844.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

② 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.

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012111014511936.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

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 item directly, then 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";

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012111015065868.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012111015084997.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

One way to do this is to point directly to the Eclipse toolbar as indicated by the icon:

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012111015110247.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

② 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.

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012111019580350.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012111019553547.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012111020011456.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

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.

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012111020061053.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012111020122362.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>

650) this.width=650; "src=" http://pic002.cnblogs.com/images/2012/465866/2012111020155831.jpg "style=" border:0px; Margin-right:auto;margin-left:auto; "/>


Android Environment Setup

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.