Build an android 4.0 SDK environment (Windows 7 Ultimate)

Source: Internet
Author: User
The android 4.0 SDK has been available for some time. I have long been trying to see how this version works. I haven't done Android development for a long time. I used Android for development before. It looks like ice cream, so it's funny to call it ice cream sandwich ....

 

  Steps for building an android environment (for reference only ):

Official building steps: http://developer.android.com/index.html

Before creating an environment, you need to download the following packages:

1. Install the Java Runtime Environment JRE (not running this eclipse) and JDK

Official download http://www.oracle.com/technetwork/java/javase/downloads/index.html,

Install JRE first, and then JDK. If you have nothing to say, just click Next ....

2. Install the android SDK

Decompress the downloaded android_sdk_r14 package and store it wherever necessary. I usually decompress the package to the eclipse file and put it under my account...

Decompress the package and run the SDK manager.exe file. We recommend that you select android1.5 to android4.0. There are 33 packages in total. Click Install 33 packages. It takes some time to install the SDK, my bandwidth is 4 m, but it's okay, about 50 mins.

  

The download result is as follows:

  

  OK. SDK installation is complete ....

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 pop-up window, enter the https://dl-ssl.google.com/android/eclipse/ and enter the key> select all> next> finish, all right, waiting 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 and the existing location is the path of the SDK 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.txtView = (TextView) findViewById(R.id.txtView);
18 if(this.txtView!=null){
19 this.txtView.setText("Hello World");
20 }
21 }
22 }
Copy code

Run

 

It's over. O (partition _ partition) O

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.