Rebuilding the android Environment

Source: Internet
Author: User
To use Code And tools to develop Android applications, you need a suitable development machine and environment, as described below.

Environment: Windows 2003

First, install jdk6(jdk-6-windows-i586.exe)

After JDK is installed, install myeclipse (myeclipse 6.0 is installed here)

(You can also install eclipse. The difference is that eclipse requires many plug-ins, while myeclipse does not have to be so troublesome. Of course, myeclipse requires money. Digress)

After the installation, start to deploy the android environment (refer to the steps below ):

1: on a Windows Server, right-click my computer, choose Properties> advanced, and click "environment variable, in the displayed dialog box, double-click the PATH variable under "system variables" to modify it, add the real path of $ sdk_root/tools (that is, the tool path under the folder after Android SDK decompression here I am C: \ downloads \ android-sdk-windows-1.5_r2 \ android-sdk-windows-1.5_r2 \ tools ).

Add the $ sdk_root/tools directory to the system path so that you do not need to enter the full path name when using ADB (Android debug Bridge) and other command line tools. If you upgrade your SDK, if it is different from the original directory, remember to update your path variable settings.

2: Install Eclipse plug-in (ADT)

If you want to use eclipse as your android applicationProgramYou can install a plug-in called ADT (Android development tools. The ADT plug-in contains a series of powerful extensions that allow you to create, run, and debug Android applications faster and more easily.

If you are not planning to use eclipse, you do not need to download and install the ADT plug-in.

To download and install the ADT plug-in, you must first set up the myeclipse remote update site. follow these steps:

1. Start myeclipse and choose help> Software Updates> Find and install...

2. Select search for new features to install in the displayed dialog box, and press next to continue.

3. Click new remote site.

4. In the displayed dialog box, enter a name (for example, Android plugin) for the remote update site, and enter the following URL:

Https://dl-ssl.google.com/android/eclipse/

Click OK.

5. Now you will see that the new site is added to the search list and checked. Click Finish.

6. After the message is updated, you will see the search results dialog box, where you can select Android plugin> eclipse integration> android

Development tools, and then press the next button.

7. Next is the license agreement for the plug-in. After reading the plug-in, Select accept terms of the license agreement and press next to continue.

8. In the install dialog box that appears, press finish to start downloading the ADT plug-in.

9. The ADT plug-in is not authenticated. You can click "Install all" to allow installation.

10. Restart myeclipse.

11. After myeclipse is restarted, set the myeclipse parameter to point it to the root directory of the Development Kit ($ sdk_root ):

A) Select WINDOW> preferences... Open the parameter settings panel

B) Select android in the left-side navigation pane.

C) Click the SDK package address in the address bar behind the SDK location on the right panel, or click the Browse button to search for the SDK package in the system. (Here I am c: \ downloads \ android-sdk-windows-1.5_r2 \ android-sdk-windows-1.5_r2)

D) enter and click OK.

Update ADT plug-in

Follow these steps to update the ADT plug-in to the latest version:

1. Select help> Software Updates> Find and install...

2. Select search for updates of the currently installed features and click Finish.

3. If an ADT update is found, select and install it.

You can also use the following method to shape the ADT plug-in:

1. Select help> Software Updates> Manage configuration.

2. Find and select Android development tools from the tree navigation bar on the left.

3. Click scan for updates in the available task entry on the right.

Develop Android applications in the myeclipse Development Environment

Before developing an Android Application in myeclipse, you need to create an android project and set the startup configuration. Then you can write, run, and debug the code.

The content after this section assumes that you have installed the ADT plug-in eclipse. If you have not installed the ADT plug-in, follow the previous steps to install the plug-in.

Create an android Project

The ADT plug-in provides a new project wizard that allows you to quickly create an android project. The procedure is as follows:

1. Select File> New> project.

2. Select Android> Android project and press the next button.

3. Select two different ways to create a new project:

? Select create new project in workspace. Create a new project.

? Select Create project from existing source to create a project in the existing code. You can use this option to create and run the sample code in the SDK package, which is located in the samples directory of the SDK package.

4. Click Finish to end the project creation.

After the project is created, the ADT plug-in automatically creates the following files and directories and places specific content:

Src/: contains your Java source file

Res/: contains resource files

Androidmanifest. xml: the manifest file of the project

Create STARTUP configuration

Before Running and debugging the android program in eclipse, you must create a STARTUP configuration. The STARTUP configuration defines the project to be started, the activity to be started, the options of the simulator, and so on.

Follow these steps to create a STARTUP configuration:

1. Select Run> open run dialog... Or run> open debug Dialog

2. In the Tree Engineering type list on the left, right-click Android Application and select new.

3. Enter your configuration name in the displayed dialog box.

4. In the following Android form, Click Browse to find your project and select the activity to start.

5. In the emulator form, set the desired screen size and network conditions. If you need to set other simulator options, refer

Http://code.google.com/android/reference/emulator.html#startup-options

6. You can set additional options in the common form.

7. Click the Apply button to save the configured configuration, or click the run or debug button.

Run and debug Android applications

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.