Build Android development environment in Windows 7

Source: Internet
Author: User

 

I wrote it once in March. I gave up Android development for various reasons. Now I have changed QQ and I have to pick up Android development again. So I wrote it again. Okay, no nonsense. The text begins...

--------------------------------- Gorgeous split line -------------------------------- 1. Install JDK 6
Download the latest JDK version: 32-bitEnvironment variable configuration is attached to environment variable configuration: New System variable JAVA_HOME: D: \ Android \ Java \ jdk1.6.0 _ 27 \ new system variable CLASSPATH :.; % JAVA_HOME % \ lib; (Note: The dot number indicates the current directory and cannot be omitted) Add the following content before the value of the Path system variable: % JAVA_HOME % \ bin; (Note: the semicolon here cannot be omitted) Here, JDK installation is complete. Click Start> Run, enter the cmd command, and enter java-version in the CMD window.
If the following interface is displayed, the installation is successful:


2. Install Eclipse

Download the latest version of Eclipse (currently Helios (3.6 )):
Http://www.eclipse.org/downloads/packages/release/helios/sr2
Select"Eclipse IDE for Java Developers, 99 MB.


After the download is complete, decompress it to the appropriate location (such as D: \ Android \ eclipse)

3. Install the Android SDK
Download the latest Android SDK
Android-sdk_r13-windows.zip
After the download is complete, decompress it to an appropriate directory (for example, D: \ Android \ android-sdk-windows), and then run SDK Manager.exeUpdate (see figure). It takes 3-5 hours, depending on the network speed. Here is the figure after the update is complete.

After the update is complete, configure the environment variables for convenience: Create a system environment variable: ANDROID_HOME: D: \ Android \ android-sdk-windows \ platform-tools; D: \ Android \ android-sdk-windows \ tools; Add % ANDROID_HOME % to PATH

  4. Install ADT(Android Development Kit, Android Development Toolkit) (1) download ADT: http://dl.google.com/android/ADT-12.0.0.zip
(2) Start Eclipse and select Help> Install New Software...
(3) In the Available Software window, click Add...

 

(4) After the installation is complete, Eclipse will be restarted. 5. Set the Android SDK
(1) choose Windows> Preferences> Android, and click "Browse…" on the SDK Location ...", Select the directory (D: \ Android-SDK-windows) where the decompressed android sdk folder is located, and click OK.
(2) choose Window> Android SDK and AVD Manager. In the displayed "Android SDK and AVD Manager" dialog box, select "Available Packages" and click "+" to expand the options. Select four options for "API 8. Click "Install Selected.
(2) The "Choose Packages to Install" dialog box is displayed. Select "Accept All" and click "Install. The "Installing Archives" dialog box is displayed. Close the window after installation.
Note: If you are not sure whether the four Packages have been correctly Installed, you can select "Installed Packages" in the "Android SDK and AVD Manager" dialog box to view the Installed software Packages.

6. Create an AVD (Android Virtual Devices = AVD, an Android Virtual device, or a simulator commonly used in Embedded Development).
(1) If the SDK is correctly installed, select "Virtual Devices" in the "Android SDK and AVD Manager" dialog box and click "New.
(2) In the Create new Android Virtual Device (AVD) dialog box, enter Android-AVD in Name and select Android 2.2-API Level 8 in Target. For other options, click "Create AVD.
(3) If the installation is successful, it will be displayed in the "Android SDK and AVD Manager" dialog box.

 

  7. Create an Android project.(Create an Android program to verify that the development environment is successfully set up)
(1) In Eclipse, choose File> New> Project...
(2) the "New Project" dialog box is displayed. Select Android> Android Project and click "Next ".
(3) the "New Android Project" dialog box is displayed.
Input: hello in Project Name
Select: Android 2.2 check box in Build Target
In the Appication name field, enter hello_android.
Enter com. android. test in Package name.
Enter HelloAndroid in Create Activity
Click "Next.
(4) "New Android Test Project" is displayed. because it is a small demo Project, you do not need to create a Test Project. Click "Finish.
(5) edit the HelloAndroid. java file.
The Code is as follows: Java code
  1. Package com. android. test;
  2. Import android. app. Activity;
  3. Import android. OS. Bundle;
  4. Import android. widget .*;
  5. Public class HelloAndroid extends Activity {
  6. Public void onCreate (Bundle savedInstanceState ){
  7. Super. onCreate (savedInstanceState );
  8. TextView textView = new TextView (this );
  9. TextView. setText ("Hello Android! ");
  10. SetContentView (textView );
  11. }
  12. }
8. Run the Android Project
(1) Click the "Run" button on the toolbar, or choose "Run"> "Run" from the menu to bring up the "Run As" dialog box. Select "Android Application" and click "OK.
(2) AVD loading speed is slow and you need to wait patiently:

 

 



 

 

 So far, the Android development environment in Windows 7 has been set up. If you have any questions, please leave a message or add me QQ: 859066216

From: pcenshao

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.