在Windows上搭建Android的JAVA开发环境图文教程(Eclipse版本)

来源:互联网 发布:网络作家苍白的黑夜 编辑:程序博客网 时间:2024/04/29 02:26

1.下载需要用到的工具:

(1)下载JAVA的IDE开发工具– Eclipse

到Eclipse官方网站下载Ecplise For Java EE的最新Windows版本

下载页面地址: http://www.eclipse.org/downloads/

下载Ecplise

下载Ecplise

(2)下载Java开发包 — Java SE Development Kit (JDK) JDK 6

到Sun官方网站下载JDK6,选择JDK 6 Update 12

下载页面地址: http://java.sun.com/javase/downloads/index.jsp

下载JDK6

下载JDK6

(3)下载Android开发包 — Android SDK

到Google的官方网站下载Android的开发包For Windows的

下载地址:http://dl.google.com/android/android-sdk-windows-1.1_r1.zip

2.下载完需要的工具之后,开始安装

(1)安装Ecplise:下载回来的Ecplise(eclipse-jee-ganymede-SR2-win32.zip)直接解压即可

(2)安装JDK6:运行下载回来的JSK安装包(jdk-6u12-windows-i586-p.exe)一路”下一步”即可

(3)安装Android开发包(SDK):下载回来的SDK包(android-sdk-windows-1.1_r1.zip)直接解压即可

3.让Ecplise自动安装Android开发插件(ADT- plugin)

(1)启动安装完(解压)后的Ecplise目录下的Ecplise.exe

(2)点击菜单”Help”->”Software Updates”,在打开的窗口中切换到选项页”Availabe Software”

(3)点击”Add site…”,加入以下地址: http://dl-ssl.google.com/android/eclipse/ 然后点击”OK”

(4)刚才加入的地址,点击”Install…”进行ADT(Android Development Tools)的安装工作.

(5)Ecplise此时会从加入的地址中自动下载跟安装ADT,稍等一会,安装完毕后,提示需要重启Ecplise,点击”OK”重启Ecplise

安装ADT

安装ADT

4.配置Andiord SDK路径

重启完Ecplise后,点击菜单”Window”->”Preference”,打开了配置窗口,在左边选中Android,在右边输入Android SDK的路径(刚才步骤1-(3)下载的Android SDK解压出来的目录),点击”OK”,至此环境配置完毕.

配置Android SDK路径

配置Android SDK路径

5.测试开发一个Android项目

(1)点击菜单”File”->”New”->”Other…”,在打开的窗口中选择”Android”->”Android Project”,点击”Next”进入下一步

(2)随便起个项目名,例如”HelloWorld”,注意Package name里需要输入”com.项目名”才能点击”Finish”继续.

新建Android项目

新建Android项目

(3)建好项目之后,点击菜单”Run”->”Run”,在弹出窗口中选择以”Android Application”模式运行程序,即可调起Android的模拟器运行测试程序了.

以Android Application运行

以Android Application运行

测试Android模拟器

测试Android模拟器

6.完成

至此Java的Android开发环境就搭好了,接下来的教程还会有C++的Android开发环境搭建,还有Android的进阶开发,欢迎持续关注.

To Be Continue

本文地址:在Windows上搭建Android的JAVA开发环境图文教程(Eclipse版本)     文章出处:一丁点

转载请以链接形式注明原始出处和作者,欢迎转载。

++++++++++++++++++++++++++搭建Google Android 2.1平台+++++++++++++++++++++++++++++++++

以下英文内容来自官网http://developer.android.com/

并加上本人的中文注解

Download the Android SDK

December 2009

The Android SDK has changed! If you’ve worked with the Android SDK before, you will notice several important differences:

·                 The SDK downloadable package includes only the latest version of the Android SDK Tools.

·                 Once you’ve installed the SDK, you now use the Android SDK and AVD Manager to download all of the SDK components that you need, such as Android platforms, SDK add-ons, tools, and documentation.

·                 The new approach is modular — you can install only the components you need and update any or all components without affecting other parts of your development environment.

·                 In short, once you’ve installed the new SDK, you will not need to download an SDK package again. Instead, you will use the Android SDK and AVD Manager to keep your development environment up-to-date.

If you are currently using the Android 1.6 SDK, you do not need to install the new SDK, because your existing SDK already includes the Android SDK and AVD Manager tool. To develop against Android 2.0.1, for example, you can just download the Android 2.0.1 platform (and updated SDK Tools) into your existing SDK. Refer to Adding SDK Components.

show moreshow less

If you are new to the Android SDK, please read the Quick Start, below, for an overview of how to install and set up the SDK.

Platform
Package
Size
MD5 Checksum

Windows
android-sdk_r04-windows.zip
23069119 bytes
c48b407de852ba483869f17337e90997

Mac OS X (intel)
android-sdk_r04-mac_86.zip
19657927 bytes
b08512765aa9b0369bb9b8fecdf763e3

Linux (i386)
android-sdk_r04-linux_86.tgz
15984887 bytes
ef84b08fd9da84f4c4ae77564fe4eaee

Quick Start

The steps below provide an overview of how to get started with the Android SDK. For detailed instructions, start with the Installing guide.

0. Prepare your development computer

Read the System Requirements document and make sure that your development computer meets the hardware and software requirements for the Android SDK. Install any additional software needed before downloading the Android SDK. In particular, if you plan to develop Android applications in the Eclipse IDE using the ADT Plugin (see below), make sure that you have the correct version of Eclipse installed.

1. Download and install the SDK starter package

Select a starter package from the table at the top of this page and download it to your development computer. To install the SDK, simply unpack the starter package to a safe location and then add the location to your PATH.

2. Install the ADT Plugin for Eclipse

If you are developing in Eclipse, set up a remote update site and install the Android Development Tools (ADT) plugin. For detailed instructions, see Installing and Updating ADT.

3. Add Android platforms to your SDK

Use the Android SDK and AVD Manager, included in the SDK starter package, to add one or more Android platforms (for example, Android 1.6 or Android 2.0) to your SDK. In most cases, you will want to download multiple platforms, so that you can build your application on the lowest version you want to support, but test against higher versions that you intend the application to run on. Information about each platform is available at left, under "Downloadable SDK Components."

To launch the Android SDK and AVD Manager on Windows, execute SDK Setup.exe, at the root of the SDK directory. On Mac OS X or Linux, execute the android tool in the <sdk>/tools/ folder. For more information about how to add platforms and other components, see Adding SDK Components.

4. Get the latest documentation

If you develop while offline, use the Android SDK and AVD Manager to download the latest documentation package. The documentation covers all versions of the API and lets you filter out those versions that your application won’t support. Once installed, the documentation is also available to you directly from the Eclipse IDE.

5. Download other SDK components

You can use the Android SDK and AVD Manager to download other SDK components, such as the SDK add-ons. An SDK add-on provides a development environment for an Android external library or a customized Android system image. For example, the Google APIs Add-On lets you develop an application that takes advantage of the Google Maps external library.

6. Get started with an application project

Once you’ve set up your SDK, the next step is to start a new application project or move existing applications into the new SDK.

If you are new to Android, you can use the Hello World tutorial to get started quickly. Next Steps offers other suggestions of how to begin. Welcome!

看起来比较麻烦,对于第一次使用的人来说是比较复杂,不过这个开发平台是我遇到过最方便的一种.

0.下载安装并SDK

1.然后下载并安装Eclipse http://www.eclipse.org/downloads/

2.在Eclipse内安装ADT(Android Development Tools)

Installing the ADT Plugin

Once you have the Eclipse IDE installed, as described in Preparing for Installation, above, follow these steps to download the ADT plugin and install it in your respective Eclipse environment.

Eclipse 3.4 (Ganymede)
Eclipse 3.5 (Galileo)

1.             Start Eclipse, then select Help > Software Updates…. In the dialog that appears, click the Available Software tab.

2.             Click Add Site…

3.             In the Add Site dialog that appears, enter this URL in the "Location" field:

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

Note: If you have trouble aqcuiring the plugin, try using "http" in the Location URL, instead of "https" (https is preferred for security reasons).

Click OK.

4.             Back in the Available Software view, you should see the plugin listed by the URL, with "Developer Tools" nested within it. Select the checkbox next to Developer Tools and click Install…

5.             On the subsequent Install window, "Android DDMS" and "Android Development Tools" should both be checked. Click Next.

6.             Read and accept the license agreement, then click Finish.

7.             Restart Eclipse.

1.             Start Eclipse, then select Help > Install New Softare.

2.             In the Available Software dialog, click Add….

3.             In the Add Site dialog that appears, enter a name for the remote site (for example, "Android Plugin") in the "Name" field.

In the "Location" field, enter this URL:

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

Note: If you have trouble aqcuiring the plugin, you can try using "http" in the URL, instead of "https" (https is preferred for security reasons).

Click OK.

4.             Back in the Available Software view, you should now see "Developer Tools" added to the list. Select the checkbox next to Developer Tools, which will automatically select the nested tools Android DDMS and Android Development Tools. Click Next.

5.             In the resulting Install Details dialog, the Android DDMS and Android Development Tools features are listed. Click Next to read and accept the license agreement and install any dependencies, then click Finish.

6.             Restart Eclipse.

Now modify your Eclipse preferences to point to the Android SDK directory:

1.             Select Window > Preferences… to open the Preferences panel (Mac OS X: Eclipse > Preferences).

2.             Select Android from the left panel.

3.             For the SDK Location in the main panel, click Browse… and locate your downloaded SDK directory.

4.             Click Apply, then OK.

Done! If you haven’t encountered any problems, then you’re ready to begin developing Android applications.

如果不能在Eclipse内直接更新ADT,可以用以下方法

1.             Download the current ADT Plugin zip file from the table below (do not unpack it).

Name

Package

Size

MD5 Checksum

ADT 0.9.5

ADT-0.9.5.zip

3372982 bytes

227ec538359fbe417ccde7f0ad614a96

2.             Follow steps 1 and 2 in the default install instructions (above).

3.             In the Add Site dialog, click Archive.

4.             Browse and select the downloaded zip file.

5.             In Eclipse 3.5 only, enter a name for the local update site (e.g., "Android Plugin") in the "Name" field.

6.             Click OK.

7.             Follow the remaining procedures as listed for default installation above, starting from step 4.

To update your plugin once you’ve installed using the zip file, you will have to follow these steps again instead of the default update instructions.

3.添加anroid平台到你的SDK

用这个工具Android SDK and AVD Manager,在Eclipse的windows菜单里,

Android SDK and AVD Manager的Available Packages点开后可以下载相应SDK平台,下载和安装完之后在Virtual Devices里添加模拟设备,

完成之后可以点start,就能运行android设备了,开机有点慢:D

好了,到这里开发环境就搭建好了

原创粉丝点击