Build an Android 2.2 Development Environment

Source: Internet
Author: User

1. Install JDK.Note that only JRE installation is not acceptable. JDK installation is required.
 

I went to the http://www.oracle.com/technetwork/java/javase/downloads/index.html to download JDK 6 Update 20.
Note: according to the official information of www.eclipse.org, JDK 6 Update 21 is installed on Windows platform, and then run eclipse Helios (3.6) will show crashing, need to make some settings (http://wiki.eclipse.org/FAQ_How_do_ I _run_Eclipse%3F#Oracle.2FSun_VM_1.6.0_21_on_Windows)

Windows 7:
1) double-click the jdk-6u20-windows-i586.exe to install
2) After the installation is complete, enter "Java-version" in the command line. If the following information appears, the installation is successful:

Java version "1.6.0 _ 20"
Java (TM) se Runtime Environment (build 1.6.0 _ 20-b02)
Java hotspot (TM) Client VM (build 16.3-b01, mixed mode, sharing)

 

 

 

 

2. Install the android SDK

This step wastes the most time and effort of the author...
Through the query information that Google Android official website has been migrated from http://dl.google.com/android to http://developer.android.com, but unfortunately the domestic website of mongo.android.com was blocked (it is really do not understand what is the reason ~~), Cannot be accessed directly.

 

You can access images from .android.com or through proxy software or online proxy. Below are some image URLs I have compiled:

Http://androidappdocs.appspot.com
Https://txt.appspot.com/developer.android.com

 

The author uses the image website androidappdocs.appspot.com to access pai.android.com.
Select the SDK tab and find that the latest Android SDK version is 2.2:

 

<Windows 7>
1) download the android-sdk_r06-windows.zip, the size is 23293160 bytes, MD5 is 7c7fcec3c6b5c7c3df6ae654b27effb5.
2) decompress the android-sdk_r06-windows.zip to the directory where you want to install Android SDK. I decompress D:/here, and then generate the D:/Android-SDK-Windows/directory.
3) add D:/Android-SDK-Windows/tools to the path in the environment variable.
4) because Google has changed the download Policy (files previously used to be sdks are integrated in an installation package and can be installed offline ), now, you must download the files to be installed from the Google website online in real time for online installation. Double-click D:/Android-SDK-Windows/SDK setup.exe to run Android SDK and AVD manager.
Generally, the following message is displayed:
Failed to fetch URL http://dl-ssl.google.com/android/repository/repository.xml, reason: Connection timed out: connect

 

We need to close the "Refresh sources" and "choose packages to install" windows, click "Settings" in the left column, and set "Force https //... select sources to be, select the "available packages" entry in the left column, and click Refresh. The installation list can be obtained successfully. (I have been paying for a long time, because no matter how I set it, I keep promptingConnection timed out: connectLater, I accidentally figured out the cause, because I used a mobile/tietong network which may block the online installation website of the android SDK. Everything works normally for the telecom network! God !!)

 

5) Select the APIS version, USB driver, SDK example program, and SDK document to be installed in the installation list.
I installed the Android 2.2 SDK with the corresponding API code 8.

 

 

4. Create a new Android Virtual Device (AVD)

 
Emulate settings when AVD is created.
1) Select "Virtual Devices" from the left side of the "android SDK and AVD manager" window"

I. Select "new"
Ii. Enter an AVD name
Iii. Select a target
Iv. Size of the input simulated SD card
V. Select a skin.
*Retain the default skin Setting Value
Make the simulator look like G1, mytouch 3G, hero, and other mobile devices...
*Select WVGA 854
Simulate Motorola Droid
*Select other options in the list
Simulate other devices
Vi. Then "create AVD"

 

PS: Now you can run the new virtual device.
Select the new virtual device from the list)

 

 

Click "start ..."

 

Click "launch"

 

PS: if an error such as error: Unknown Virtual Device name is encountered, it is generally caused by a wrong file path reference.
For example, you can set a user file to drive F in Vista. In this way, when you use eclipse or create an android emulator from the command line, the corresponding file is placed to "F:/users/<username> /. android ", while the program is still running from" C:/users/<username> /. android "to find the corresponding configuration file, resulting in the above error.
 

Solution 1 (this is also the method used by the author ):
Add an environment variable named "android_sdk_home" (this variable name cannot be changed. It can only be this name !), Then change the variable value ". android "folder (AVD information) location, here I set it to Android SDK package, value:" D:/Android-SDK-Windows ", the problem is solved.

Solution 2:
Put "F:/users/<username> /. copy the file under android to C:/users/<username> /. android "can also solve this problem below, but this solution has a major drawback, that is, if you create another AVD, you have to re-copy it.

It takes several minutes to run for the first time.

 

 

5. Install eclipse (version 3.5 is recommended)
If you need to install or update eclipse, you can download it from this location:
Http://www.eclipse.org/downloads (a Java or RCP version of eclipse is recommended .)

I have installed Eclipse IDE for Java developers (eclipse Helios, 3.6 ).
After the download is complete, decompress the package directly (the author's installation path is C:/program files/eclipse_java ).

 

6. Install the android ADT plug-in of eclipse
1) You can download this ADT plug-in directly on the android official website.
The author is to the http://androidappdocs.appspot.com/sdk/eclipse-adt.html#installing here download adt-0.9.7.zip, the size is 8033750 bytes, MD5 is de2431c8d4786d1_ae5bfc95b4605df

 

Next, install the ADT plug-in. Here we use the direct copy method to install the plug-in. You can also install the plug-in through links.

 

The installation instructions in links mode are as follows:
Create C:/program files/eclipse_java/myplugins/and C:/program files/eclipse_java/myplugins/androidadt/Eclipse/directory to copy all the files obtained from the unzip ADT-0.9.7.zip to C: /program files/eclipse_java/myplugins/androidadt/Eclipse/directory.

 

Create the C:/program files/eclipse_java/links/directory, create a text file androidadt. Link under the directory, and write the following content:
Path = C:/program files/eclipse_java/myplugins/androidadt

 

If it fails, delete the org. Eclipse. Update folder under the C:/program files/eclipse_java/configuration directory, and restart eclipse.

 

At startup, eclipse will go to the specified directory to find the eclipse/features directory and Eclipse/Plugins directory to see if there are legal functional components and (or) plug-ins. That is to say, the target directory must contain a/eclipse directory. If the attached feature and plug-in are found, the configuration is available during the runtime. If the linked file is added after the workspace is created, the additional feature and plug-in will be processed as new configuration changes.

Additional instructions
1. Plug-ins can be installed in multiple custom directories.
2. Multiple plug-ins can be installed in a custom directory.
3. The file name and extension name of The Link file can be any name, such as ddd.txt and myplugin.
4. In the link file, Path = the path of the plug-in directory must be separated by // or/
5. The link file can have multiple lines of Path = plug-in Directory, which corresponds to multiple custom plug-in directories. The path parameter of each line will take effect.
6. There can also be multiple link files in the links directory, and the path parameter in each link file will take effect.
7. The plug-in directory can use relative paths.
8. You can create a subdirectory in the links directory to transfer unused plug-ins to this subdirectory to accelerate eclipse startup.
9. If no plug-in is visible after installation, delete the configuration/org. Eclipse. Update/directory in the eclipse installation directory and restart eclipse.

 

2) in this step, you can also download the update feature of Eclipse:
Start eclipse and choose help> soft updates> Find and install ...]
(Or [help]> [Soft updates], in the dialog that appears, click the available software tab)

In the "location" field, enter this URL:
Https://dl-ssl.google.com/android/eclipse/

 

In this case, the "https://dl-ssl.google.com/android/eclipse/option" option is added to the window. Select this option and click "Installation Details ...] Click the button to download.

 
If eclipse can not find the remote update site containing the ADT plugin, try changing the remote site URL to use HTTP, rather than HTTPS. That is, set the location for the remote site:
Http://dl-ssl.google.com/android/eclipse/

 

Note: many domestic users cannot complete such upgrades. Generally, this is not reflected in the first half (Other plug-ins, such as pydev ).

 

7. Configure eclipse and Android ADT plug-ins

1) set the Java JDK attribute of eclipse
Select WINDOW> preferences ...] Open the edit Properties window, select the Java properties panel, select Java compiler 6.0, and click Apply, and OK.

2) set the android SDK
Choose Windows> preferences ...] Open the edit Properties window, select the android properties panel, and add the android SDK directory (click [browse ...] Select, here is the "D:/Android-SDK-Windows/" directory ).

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.