Build android with eclipse + JDK + SDK in Windows

Source: Internet
Author: User

 

Related downloads

(1) download Java JDK:

Enter the webpage:Http://java.sun.com/javase/downloads/index.jsp(Or directlyClick to download) For example:


Select Download JDK to download only JDK. You do not need to download JRE.

(2) download eclipse

Enter the webpage:Http://www.eclipse.org/downloads/(Or directly click to download:BT downloadHTTP download) For example:


Select the first one (Eclipse IDE for Java EE developers)

(3) download the android SDK

Note: Two Types of Android SDK Download versions are available: one is the SDK with a specific version, and the other is the upgrade tool without a specific SDK version, the latter is more than 20 m, and the former is more than 70 m.

Full Version Download (Android SDK 2.1 R01) upgraded version download (this is recommended. This example uses this version, which does not include a specific version. You only need to upgrade the version in eclipse)

2. Software Installation

(1) install JDK 6a7After installation is complete, no environment variables need to be configured.

(2) decompress eclipseEclipse does not require installation. After decompression, open it directly.

 (3) decompress the android SDKThis does not require installation. decompress the package for later use.

(4) three folders finally exist.Such:


3. Eclipse Configuration

1. Install the android development plug-in

(1) Open eclipse and choose help> install new software on the menu bar. The following page is displayed:


Click Add. The following page is displayed.


Enter the URL:Http://dl-ssl.google.com/android/eclipse/ (If an error occurs, change HTTP to HTTPS.)

Name: Android (which can be customized here)

Click OK. The following page is displayed.


ClickNextButton, the following interface is displayed:


ClickNextButton, the following interface is displayed:


SelectI accept the terms of the license agreementsClickNextTo go to the plug-in installation page.

 

After the installation is complete, the following page appears:


ClickYesButton,Restart eclipse

2. Configure the android SDK

(1) Click WINDOW> preferences to go to the following page:


If you select the decompressed directory of your android SDK, an error will be reported if you select an error. This is an upgrade tool. Currently, no SDK version is available.

Note: If the upgrade fails, go to the Android-SDK-Windows directory,Run and install"SDK setup.exe"

 
If the message is "failed to fetch URL ..." Error Message, You need to change the HTTPS Method to the HTTP method as follows:

If this error occurs, follow the steps below.
1) in the "android SDK and AVD manager" window, select "Settings" on the left"

2) Select "Force https ://... "This option

 

(2) Upgrade the SDK version. Choose WINDOW> Android SDK and AVD Manager. The following page is displayed:


Select the update all button. The following page is displayed:


Select an item on the left, click accept to install, and click reject to disable installation. Here I only select SDK 2.1 and samples for API 7, and I can customize it myself. After confirming, select the Install button to go to the installation interface as follows:

The installation is completed as follows:

(3) create an AVD (Android vitural device), enter the android SDK and AVD manager, select vitural devices, and click the new button.


Click the new button to go to the following page:

The name can be retrieved as needed. Select the desired SDK version for target, set the SD card size, and click Create AVD. the following result is displayed.

The above shows that AVD has been created.

3. Create an android Project

(1) choose File> New> Other To Go To The following page:

Select "create Android project" and click "Next" to go to the following page:


Name customization, application name customization, registration must contain more than one point, Min SDK version must enter an integer

(2) Click Next to display the following interface:

 

Note: if an error occurs, such as project... is Missing required source folder: 'gen', then gen-> android. test-> r. if the Java file is deleted, eclipse will generate the file again for us and no error will be reported. If this method does not work, try the following method (because I tried this method and found that it does not work, I explored the following method to solve the problem)
Note: If the setcontentview (R. layout. Main) error occurs, Google APIs may not be installed. The installation steps are as follows:

1. menu windows -- "Android SDK and AVD Manager

2. See:

 

3. After installation, windows -- perferences, as shown in:

 

(3) configure and run

Right-click the project and choose run as> RUN configuration to go to the following page:

Click the Browse button to select the project you want to run.

Select target to switch to the following page:


Select the running AVD on this page and set the box in front of the AVD to the selection status.

 

(4) run the test project

Right-click the project name and choose run as> Android Application to start running the androidProgram, As shown below:


Entering

Test program running result


Conclusion

Now, the android development environment has been set up. If you have any questions, please leave a message. Note that I only downloaded the android SDK R4 upgrade tool. Instead of downloading the specific SDK, I upgraded it through the android SDK management tool in eclipse, you can also download the specific SDK version directly, for example, Android SDK 2.1 R1 has this download link, but it is better to use the upgrade tool for my task.

 

Reprinted statement:This article is transferred fromHttp://hi.baidu.com/sunboy_2050/blog/item/2ee138f82463cc08a9d311b1.html

 

Reference recommendations:

Installing the SDK (Android Developer)

Build android with eclipse + JDK + SDK on Ubuntu

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.