热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

WindowsXP下Android开发环境搭建(二)

最近要学习Android,首先第一件事就是搭建Android的开发环境,几经周折终于搞定,其中参考了很多好的博文和其他资料,

最近要学习Android,首先第一件事就是搭建 Android  的开发环境,几经周折终于搞定,其中参考了很多好的博文和其他资料,写下来为了感谢博友,也为了分享经验,共同进步。

 

 具体步骤如下(接上篇日志):


5. 安装 Eclipse Android ADT 插件


1) 可以直接到 Android 官网去下载这个 ADT 插件。
笔者是到   http://androidappdocs.appspot.com/sdk/eclipse-adt.html#installing   这里下载了 ADT-0.9.9.zip ,

此处参考英文,其实都是很简单的英文,不浪费时间

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

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 acquiring 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.

Configuring the ADT Plugin

Once you've successfully downloaded ADT as described above, the next step is to modify your ADT preferences in Eclipse 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 the installation is complete. Now read Adding Platforms and Other Components for instructions on how to complete the setup of your SDK environment.

Troubleshooting ADT Installation

If you are having trouble downloading the ADT plugin after following the steps above, here are some suggestions:

·         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 to:

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

·         If you are behind a firewall (such as a corporate firewall), make sure that you have properly configured your proxy settings in Eclipse. In Eclipse 3.3/3.4, you can configure proxy information from the main Eclipse menu in Window (on Mac OS X, Eclipse ) > Preferences > General > Network Connections .

If you are still unable to use Eclipse to download the ADT plugin as a remote update site, you can download the ADT zip file to your local machine and manually install it:

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

Name

Package

Size

MD5 Checksum

ADT 0.9.9

ADT-0.9.9.zip

8301681 bytes

7deff0c9b25940a74cea7a0815a3bc36

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.

Other install errors

Note that there are features of ADT that require some optional Eclipse components (for example, WST). If you encounter an error when installing ADT, your Eclipse installion might not include these components. For information about how to quickly add the necessary components to your Eclipse installation, see the troubleshooting topic ADT Installation Error: "requires plug-in org.eclipse.wst.sse.ui" .

 

6. 配置 Eclipse Android ADT 插件

1) 设置 Eclipse 的 Java JDK 属性设置
    选择【 Window 】 > 【 Preferences… 】打开编辑属性窗口;选择 Java 属性面板;选择 Java 编译器为 6.0 ;点击 Apply ,和 OK 。

2) 进行 Android SDK 设置
    选择【 Windows 】 > 【 Preferences… 】打开编辑属性窗口;选择 Android 属性面板;加入 Android SDK 的目录(点击【 Browse… 】进行选择,这里是 "D:/android-sdk-windows/" 目录)。

7. 测试开发环境

 

搭建好开发环境之后,我们来创建一个 Hello World 工程,体验一下 Android 的开发。  
    1) 选择【 File 】 > 【 New 】 > 【 Project 】  
    2) 选择【 Android 】 > 【 Android Project 】,点击【 Next 】

Windows XP下Android开发环境搭建(二) - yuyanchao2005@126 - yuyanchao2005@126的博客
 

 

    3) 对新工程进行设置,点击 Finish

    Windows XP下Android开发环境搭建(二) - yuyanchao2005@126 - yuyanchao2005@126的博客

 

 

    4) 将文件 HelloAndroid.java 中的代码修改为 :

 

package com.example.hello;

 




public class HelloAndroid extends Activity
{
   
/** Called when the activity is first created. */
    @Override
   
public void onCreate(Bundle savedInstanceState)
    {
       
super .onCreate(savedInstanceState);
        TextView tv = new TextView(this);
        tv.setText("Hello, Android");

        setContentView(tv);
    }
}

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

 

运行程序,第一次启动 AVD ,时间有点长,运行效果为 :

Windows XP下Android开发环境搭建(二) - yuyanchao2005@126 - yuyanchao2005@126的博客
 

 

 参考博客及其他资料:

http://blog.csdn.net/Mac_cm/archive/2009/01/06/3720492.aspx

(如何在Windows下搭建Android开发环境)

http://blog.163.com/liu_yang1234/blog/static/24474310201081734627645/

(详解)Eclipse3.6搭建 Android 2.2 开发环境

http://ethan163.javaeye.com/blog/792209

http://androidappdocs.appspot.com/sdk/installing.html



推荐阅读
  • 深入理解 Oracle 存储函数:计算员工年收入
    本文介绍如何使用 Oracle 存储函数查询特定员工的年收入。我们将详细解释存储函数的创建过程,并提供完整的代码示例。 ... [详细]
  • 1:有如下一段程序:packagea.b.c;publicclassTest{privatestaticinti0;publicintgetNext(){return ... [详细]
  • 深入理解Cookie与Session会话管理
    本文详细介绍了如何通过HTTP响应和请求处理浏览器的Cookie信息,以及如何创建、设置和管理Cookie。同时探讨了会话跟踪技术中的Session机制,解释其原理及应用场景。 ... [详细]
  • 本文介绍了一款用于自动化部署 Linux 服务的 Bash 脚本。该脚本不仅涵盖了基本的文件复制和目录创建,还处理了系统服务的配置和启动,确保在多种 Linux 发行版上都能顺利运行。 ... [详细]
  • 360SRC安全应急响应:从漏洞提交到修复的全过程
    本文详细介绍了360SRC平台处理一起关键安全事件的过程,涵盖从漏洞提交、验证、排查到最终修复的各个环节。通过这一案例,展示了360在安全应急响应方面的专业能力和严谨态度。 ... [详细]
  • 几何画板展示电场线与等势面的交互关系
    几何画板是一款功能强大的物理教学软件,具备丰富的绘图和度量工具。它不仅能够模拟物理实验过程,还能通过定量分析揭示物理现象背后的规律,尤其适用于难以在实际实验中展示的内容。本文将介绍如何使用几何画板演示电场线与等势面之间的关系。 ... [详细]
  • MySQL中枚举类型的所有可能值获取方法
    本文介绍了一种在MySQL数据库中查询枚举(ENUM)类型字段所有可能取值的方法,帮助开发者更好地理解和利用这一数据类型。 ... [详细]
  • 本文介绍如何在应用程序中使用文本输入框创建密码输入框,并通过设置掩码来隐藏用户输入的内容。我们将详细解释代码实现,并提供专业的补充说明。 ... [详细]
  • 本文介绍如何通过SQL查询从JDE(JD Edwards)系统中提取所有字典数据,涵盖关键表的关联和字段选择。具体包括F0004和F0005系列表的数据提取方法。 ... [详细]
  • 本文详细介绍了如何通过命令行启动MySQL服务,包括打开命令提示符窗口、进入MySQL的bin目录、输入正确的连接命令以及注意事项。文中还提供了更多相关命令的资源链接。 ... [详细]
  • 本文介绍如何使用 NSTimer 实现倒计时功能,详细讲解了初始化方法、参数配置以及具体实现步骤。通过示例代码展示如何创建和管理定时器,确保在指定时间间隔内执行特定任务。 ... [详细]
  • 当unique验证运到图片上传时
    2019独角兽企业重金招聘Python工程师标准model:public$imageFile;publicfunctionrules(){return[[[na ... [详细]
  • 在Linux系统上构建Web服务器的详细步骤
    本文详细介绍了如何在Linux系统上搭建Web服务器的过程,包括安装Apache、PHP和MySQL等关键组件,以及遇到的一些常见问题及其解决方案。 ... [详细]
  • 本文将详细介绍如何在ThinkPHP6框架中实现多数据库的部署,包括读写分离的策略,以及如何通过负载均衡和MySQL同步技术优化数据库性能。 ... [详细]
  • 在Ubuntu 16.04 LTS上配置Qt Creator开发环境
    本文详细介绍了如何在Ubuntu 16.04 LTS系统中安装和配置Qt Creator,涵盖了从下载到安装的全过程,并提供了常见问题的解决方案。 ... [详细]
author-avatar
壹花壹浄土
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有