Building a Android Development Environment

Source: Internet
Author: User

Note: This article provides a summary of the simple process of installing the android Development Environment on my host by referring to relevant online tutorials.

1. Official setup steps:

Http://developer.android.com/index.html

2. Download the related development software (taking android4.0 as an example ):

2.1 Jave related software:

Install the Java Runtime Environment JRE (this eclipse cannot run) and JDK.

Download http://www.oracle.com/technetwork/java/javase/downloads/index.html

Install JRE first and then JDK.

Android SDK 2.2

Download http://developer.android.com/sdk/index.html

Android SDK is a free-of-Installation Software. After downloading the software package, extract the software package directly to a directory on the disk.

After the package is decompressed, three related folders or files are visible in the first-level Directory: Eclipse folder, SDK folder, and SDK manager.exe executable file.

2.3 Regarding SDK manager, there are no platform packages such as android1.6 (API 4) and android2.3.3 (API 10:

Solution:

This fault is caused by the reason that the relevant IP address is forbidden to access.

Attacked
To C: \ windows \ system32 \ drivers \ etc hosts to join # Google homepage 203.208.46.146 www.google.com # This line is to facilitate opening the android development official website. Now it seems that no Fan Qiang can open 74.125.113.121 pai.android.com download the URL 203.208.46.146 DL. google. com203.208.46.146 dl-ssl.google.com

If the message is "failed to fetch URL ..." So you need to change the HTTPS mode to the http mode, as shown in the following figure:

Go to SDK maneger.exe and run packages-> reload to reload all versions of Android platform, as shown in:

3. Install Android ADT (Eclipse plug-in)

Eclipse official download http://www.eclipse.org/downloads/, select Eclipse IDE for Java EE developers, 212 MB, the original name is Helios, now called indigo, upgrade too fast, run the eclipse interface, select the menu bar help> install new software

  

In the displayed window, enter
Https://dl-ssl.google.com/android/eclipse/ and then enter key> select all> next> finish, all right, wait for installation ....

  

  

 

After the installation is complete, you need to restart eclipse. After the restart, eclipse will automatically pop up the path of the specified SDK, select use existing sdks, existing
Location is the SDK path in step 2,

Next> finish.

  

  ADT installation is complete ....

Different from previous versions, SDK management and ADT management are separated and have two icons

.

 

4. Configure the android Simulator

Click the button on the right (like a mobile phone), open the AVD manager, click New to create a simulator, enter name avd4.0, specify target to select android4.0, then the size of the SD card is allocated to 256 MB, and then create AVD.

  

  AVD created ....

 

5. Our Hello World (we run it together !)

Select File> New> Android project and name it helloworld.

Write code:

 

1 package Allen. Liu. helloworld;

2

3 Import Android. App. activity;

4 Import Android. OS. Bundle;

5 import Android. widget. textview;

6

7 public class helloworldactivity extends activity {

8

9 private textview txtview;

10

11/** called when the activity is first created .*/

12 @ override

13 public void oncreate (bundle savedinstancestate ){

14 super. oncreate (savedinstancestate );

15 setcontentview (R. layout. Main );

16

17 this.txt view = (textview) findviewbyid(r.id.txt view );

18 if(this.txt view! = NULL ){

19 this.txt view. settext ("Hello World ");

20}

21}

22} Run

 

 

(End)

Author: Liu likui

Reprinted from: http://www.2cto.com/kf/201111/111042.html

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.