如何在eclipse中添加adtndroid ADT

如何导入android中的sample例子到eclipse中 -
- ITeye技术网站
如何导入android中的sample例子到eclipse中 AndroidEclipseWindowsBlog.之前文章《Android SDK 2.2 和ADT插件开发环境安装过程》中提起过下载sample包,而今想把sample导入到eclipse中,却发现使用【File】-【Import...】-【General】-【Existing Projects into Workspace】,选择【Select root directory】,单击【Browse...】,选择“D:\android-sdk_r06-windows\samples\android-8”,结果显示:No projects are found to import
后使用如下方法即可。
使用【File】-【Others...】-【Android】-【Android Project】,单击【Next】,选中【Create project from existing sample】单选框,此时Samples复选框可选,选择某个sample,单击【Finish】即可,此后会在eclipse的Package explorer中看到:
最后会发现在D:\android-sdk_r06-windows\samples\android-8\ApiDemos会多出如下三个文件(.classpath、.project、default.properties):
rexueboy2011
浏览: 2179 次
来自: 北京& 详解如何创建和使用AVD
详解如何创建和使用AVD
&&&&&&&进行Android开发必然要使用Android模拟器AVD,本文就具体介绍如何创建和使用AVD。&&&&&& 1、创建AVD&&&&&& 在android sdk 1.5 版本以后的开发中,必须至少创建一个,每个AVD模拟一套虚拟设备来运行Android应用程序。无论是在下或者命令行下创建新的avd,系统会在系统默认文件路径下自动创建一个.android 文件夹,所创建的有关avd的配置信息则被保存在该.android目录下,如:&&&&&& C:\Documents and Settings\Administrator\.android&&&&&& 1)命令行方式创建AVD&&&&&& 进入目录下的tools子目录,运行:&&&&&& android create avd -n my_android2.2 -t 2&&&&&& 如:android create avd &name adk_1_5_version --target 2&&&&&& 在创建avd文件得第二步,控制台提示&是否自定义自己得设备&,默认选项是&no&,如果输入 &y&,接下来可以一步步根据提示,定制自己得模拟器性能参数。&&&&&& 这里t代表target目标平台的API Level,我们可以使用android list targets来查看这里t的可选参数。&&&&&& 进入Android SDK目录下的tools子目录,运行:android list targets&&&&&& 2)开发工具创建AVD&&&&&& 1、在Eclipse中。选择Windows & Android SDK and AVD Manager。&&&&&&&2、点击左侧面板的Virtual Devices,再右侧点击New。&&&&&& 3、填入Name,选择Target的API,SD Card大小任意,Skin随便选,Hardware目前保持默认值。&&&&&& 4、点击Create AVD即可完成创建AVD。&&&&&& 注意:如果你点击左侧面板的Virtual Devices,再右侧点击New ,而target下拉列表没有可选项时,这时候点击左侧面板的Available Packages,在右侧勾选,然后点击Install Selected按钮,接下来就是按提示做就行了。&&&&&& 2、创建镜像文件 &&&&&& 进入Android SDK目录下的tools子目录,运行&&&&&& mksdcard -l sdcard 512M& e:\sdcard.img&&&&&& 这样就创建了一个512M的SD卡镜像文件:查看E盘,E盘下会有一个sdcard.img 文件。&&&&&& 3、命令行下运行AVD时加载sdcard&&&&&& 进入Android SDK目录下的tools子目录,运行&&&&&& emulator -avd MyAVD -sdcard android.img&&&&&& 如果不想每次都加-sdcard $sdcard_path,有两个办法:&&&&&& 解决办法一:可以把sdcard.img 复制到C:\Documents and Settings\Administrator\.android\avd\下对应的AVD目录下。&&&&&& 解决办法二:修改配置文件,C:\Documents and Settings\Administrator\.android\avd\AVD_NAME.avd\,打开config.ini,加入以下行:sdcard.path=你的SD卡路径。&&&&&& 4、AVD路径设置&&&&&& 前面提到,不管用Eclipse还是从命令行创建Android Emulator时,相应的文件是被放置到 &C:\Documents and Settings\Administrator\.android& 下面。如果想改变AVD的路径设置,也有2个办法:&&&&&& 解决办法一:&&&&&& 新添加一个环境变量,名字为 &ANDROID_SDK_HOME&,然后把变量值改为你想将&.android&文件夹(AVD信息)所放置的位置&&&&&& 解决办法二:&&&&&& 修改配置文件中的路径,比如我的AVD名称是MyAVD, 打开C:\Documents and Settings\Administrator\.android\avd目录中的文件MyAVD.ini文件,找到&&&&&& target=android-5path&&&&&&&&&&&& =C:\Documents and Settings\Administrator\.android\avd\MyAVD.avd&&&&&& 修改其路径即可。&&&&&& 遇到ERROR: unknown virtual device name 这样的问题一般是由于AVD文件路径引用错误造成的。
本文发布:
本文地址:
发布:鸡啄米
&&( 22:31:56)&&( 21:0:48)&&( 23:7:25)&&( 23:21:21)&&( 0:17:57)&&( 21:42:3)&&( 22:17:21)&&( 22:17:26)&&( 22:17:46)&&( 21:8:7)
完全随机文章【教程】【多图详解】如何在Eclipse中离线安装ADT(Android Development Tools)
本来正常情况的话,去下载集成好ADT的Eclipse,就可以直接使用了:
但是呢,()有时候,是本身已经有了Eclipse了,是需要(通过Eclipse)在线下载和安装ADT的。
(可参考官网的教程:)
结果就遇到了这种问题:
即,在输入了:
https://dl-/android/eclipse/
结果死掉了,处于Pending状态。
那是因为Dang屏蔽了google的一些站点,导致无法在线下载ADT。
解决办法就是,手动下载ADT,然后安装到Eclipse中去。
下面就来介绍,如何下载ADT,如何离线安装ADT。
找到了最新版本的ADT 21.0.1的下载地址:
MD5 Checksum
<font style="font-size: 10.5pt" color="#569302 bytes
acfb01bf3fd488c3dd16bf
对应的地址是:
其他版本的下载地址,可以通过替换版本号的方法获得:
也可以把对应的版本号,换成对应的版本,
比如对于20.0.2的版本,地址就是:
各个版本号,可以从:
中得到,此处摘录如下:
ADT 21.0.1 (December 2012)
ADT 21.0.0 (November 2012)
ADT 20.0.3 (August 2012)
ADT 20.0.2 (July 2012)
ADT 20.0.1 (July 2012)
ADT 20.0.0 (June 2012)
ADT 18.0.0 (April 2012)
ADT 17.0.0 (March 2012)
ADT 16.0.1 (December 2011)
ADT 16.0.0 (December 2011)
ADT 15.0.1 (November 2011)
ADT 15.0.0 (October 2011)
ADT 14.0.0 (October 2011)
ADT 12.0.0 (July 2011)
ADT 11.0.0 (June 2011)
ADT 10.0.1 (March 2011)
ADT 10.0.0 (February 2011)
ADT 9.0.0 (January 2011)
ADT 8.0.1 (December 2010)
ADT 8.0.0 (December 2010)
ADT 0.9.9 (September 2010)
ADT 0.9.8 (September 2010)
ADT 0.9.7 (May 2010)
ADT 0.9.6 (March 2010)
ADT 0.9.5 (December 2009)
ADT 0.9.4 (October 2009)
然后,下载得到,不到20MB的,最新的21.0.1版本的:
ADT-21.0.1.zip
(注:此处无需解压,后面可直接导入此zip文件的)
Eclipse中离线安装ADT
打开Eclipse,点击
Help -& Install New Software:
然后点击Archive,添加对应的上面的ADT-21.0.1.zip:
OK后,再写上一个名字,比如ADT-21.0.1:
然后经过Pending解析后,就可以看到对应的:
Developer Tools
NDK Plugins
选中Developer Tools:
然后Next,然后继续next:
点击接受协议和完成:
然后就是去安装了:
中间会有安全提示,点击OK即可:
安装完毕后,会要求重启Eclipse:
重启Eclipse后,再去新建:
就可以看到有Android项目了:
至此,离线安装ADT就完成了。
另外,你也可以在工具栏中看到对应的:
Android SDK Manager
和 Android Virtual Device Manger:
了,当然,这两个东西,都本身就可以在Window中看到:
总体来说,Eclipse中离线安装ADT,还是很简单的。
复杂的,在后面:
接下来的事情,就是如何使用ADT开发的事情了。
不了解的,可参考:
共享此文章:
免费的格式化Javascript源码的网站
查询Unicode字符,且还带Oct,Decimal,Hex,HTML Entity
HTML和Javascript都支持,很好用。adt或eclipse中Android工程怎么互相引用 - Android当前位置:& &&&adt或eclipse中Android工程怎么互相引用adt或eclipse中Android工程怎么互相引用&&网友分享于:&&浏览:0次adt或eclipse中Android工程如何互相引用
Referencing a library project
If you are developing an application and want to include the shared code or resources from a library project, you can do so easily by adding a reference to the library project in the application project's Properties.
To add a reference to a library project, follow these steps:
In the Package Explorer, right-click the dependent project and select Properties.
In the Properties window, select the "Android" properties group at left and locate the Library properties at right.
Click Add to open the Project Selection dialog.
From the list of available library projects, select a project and click OK.
When the dialog closes, click Apply in the Properties window.
Click OK to close the Properties window.
As soon as the Properties dialog closes, Eclipse rebuilds the project, including the contents of the library project.
Figure 2 shows the Properties dialog that lets you add library references and move them up and down in priority.
Figure 2. Adding a reference to a library project in the properties of an application project.
If you are adding references to multiple libraries, note that you can set their relative priority (and merge order) by selecting a library and using the Up and Down controls. The tools merge the referenced libraries with your application starting from lowest priority (bottom of the list) to highest (top of the list). If more than one library defines the same resource ID, the tools select the resource from the library with higher priority. The application itself has highest priority and its resources are always used in preference to identical resource IDs defined in libraries.
Declaring library components in the the manifest file
In the manifest file of the application project, you must add declarations of all components that the application will use that are imported from a library project. For example, you must declare any &activity&, &service&, &receiver&, &provider&, and so on, as well as&permission&, &uses-library&, and similar elements.
Declarations should reference the library components by their fully-qualified package names, where appropriate.
For example, the TicTacToeMain example application declares the library Activity GameActivity like this:
&manifest&
&application&
&activity android:name="com.example.android.tictactoe.library.GameActivity" /&
&/application&
&/manifest&
12345678910
12345678910
12345678910 上一篇:下一篇:文章评论相关解决方案 12345678910 Copyright & &&版权所有

我要回帖

更多关于 eclipse中添加adt 的文章

 

随机推荐