热门标签 | 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



推荐阅读
  • Mac OS 升级到11.2.2 Eclipse打不开了,报错Failed to create the Java Virtual Machine
    本文介绍了在Mac OS升级到11.2.2版本后,使用Eclipse打开时出现报错Failed to create the Java Virtual Machine的问题,并提供了解决方法。 ... [详细]
  • 知识图谱——机器大脑中的知识库
    本文介绍了知识图谱在机器大脑中的应用,以及搜索引擎在知识图谱方面的发展。以谷歌知识图谱为例,说明了知识图谱的智能化特点。通过搜索引擎用户可以获取更加智能化的答案,如搜索关键词"Marie Curie",会得到居里夫人的详细信息以及与之相关的历史人物。知识图谱的出现引起了搜索引擎行业的变革,不仅美国的微软必应,中国的百度、搜狗等搜索引擎公司也纷纷推出了自己的知识图谱。 ... [详细]
  • Redis底层数据结构之压缩列表的介绍及实现原理
    本文介绍了Redis底层数据结构之压缩列表的概念、实现原理以及使用场景。压缩列表是Redis为了节约内存而开发的一种顺序数据结构,由特殊编码的连续内存块组成。文章详细解释了压缩列表的构成和各个属性的含义,以及如何通过指针来计算表尾节点的地址。压缩列表适用于列表键和哈希键中只包含少量小整数值和短字符串的情况。通过使用压缩列表,可以有效减少内存占用,提升Redis的性能。 ... [详细]
  • android listview OnItemClickListener失效原因
    最近在做listview时发现OnItemClickListener失效的问题,经过查找发现是因为button的原因。不仅listitem中存在button会影响OnItemClickListener事件的失效,还会导致单击后listview每个item的背景改变,使得item中的所有有关焦点的事件都失效。本文给出了一个范例来说明这种情况,并提供了解决方法。 ... [详细]
  • 本文详细介绍了PHP中与URL处理相关的三个函数:http_build_query、parse_str和查询字符串的解析。通过示例和语法说明,讲解了这些函数的使用方法和作用,帮助读者更好地理解和应用。 ... [详细]
  • MACElasticsearch安装步骤及验证方法
    本文介绍了MACElasticsearch的安装步骤,包括下载ZIP文件、解压到安装目录、启动服务,并提供了验证启动是否成功的方法。同时,还介绍了安装elasticsearch-head插件的方法,以便于进行查询操作。 ... [详细]
  • 本文详细介绍了Linux中进程控制块PCBtask_struct结构体的结构和作用,包括进程状态、进程号、待处理信号、进程地址空间、调度标志、锁深度、基本时间片、调度策略以及内存管理信息等方面的内容。阅读本文可以更加深入地了解Linux进程管理的原理和机制。 ... [详细]
  • 本文介绍了PhysioNet网站提供的生理信号处理工具箱WFDB Toolbox for Matlab的安装和使用方法。通过下载并添加到Matlab路径中或直接在Matlab中输入相关内容,即可完成安装。该工具箱提供了一系列函数,可以方便地处理生理信号数据。详细的安装和使用方法可以参考本文内容。 ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • 《数据结构》学习笔记3——串匹配算法性能评估
    本文主要讨论串匹配算法的性能评估,包括模式匹配、字符种类数量、算法复杂度等内容。通过借助C++中的头文件和库,可以实现对串的匹配操作。其中蛮力算法的复杂度为O(m*n),通过随机取出长度为m的子串作为模式P,在文本T中进行匹配,统计平均复杂度。对于成功和失败的匹配分别进行测试,分析其平均复杂度。详情请参考相关学习资源。 ... [详细]
  • 本文介绍了通过ABAP开发往外网发邮件的需求,并提供了配置和代码整理的资料。其中包括了配置SAP邮件服务器的步骤和ABAP写发送邮件代码的过程。通过RZ10配置参数和icm/server_port_1的设定,可以实现向Sap User和外部邮件发送邮件的功能。希望对需要的开发人员有帮助。摘要长度:184字。 ... [详细]
  • 本文介绍了关于apache、phpmyadmin、mysql、php、emacs、path等知识点,以及如何搭建php环境。文章提供了详细的安装步骤和所需软件列表,希望能帮助读者解决与LAMP相关的技术问题。 ... [详细]
  • 本文介绍了在Windows环境下如何配置php+apache环境,包括下载php7和apache2.4、安装vc2015运行时环境、启动php7和apache2.4等步骤。希望对需要搭建php7环境的读者有一定的参考价值。摘要长度为169字。 ... [详细]
  • Java程序设计第4周学习总结及注释应用的开发笔记
    本文由编程笔记#小编为大家整理,主要介绍了201521123087《Java程序设计》第4周学习总结相关的知识,包括注释的应用和使用类的注释与方法的注释进行注释的方法,并在Eclipse中查看。摘要内容大约为150字,提供了一定的参考价值。 ... [详细]
  • Week04面向对象设计与继承学习总结及作业要求
    本文总结了Week04面向对象设计与继承的重要知识点,包括对象、类、封装性、静态属性、静态方法、重载、继承和多态等。同时,还介绍了私有构造函数在类外部无法被调用、static不能访问非静态属性以及该类实例可以共享类里的static属性等内容。此外,还提到了作业要求,包括讲述一个在网上商城购物或在班级博客进行学习的故事,并使用Markdown的加粗标记和语句块标记标注关键名词和动词。最后,还提到了参考资料中关于UML类图如何绘制的范例。 ... [详细]
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社区 版权所有