Android初次使用遇到的两个问题

Android是谷歌在自己手机上面推出的一个开发平台,初次使用,遇到了两个问题。

[b]问题一:[/b]Still no compatible AVDs with target 'Android 1.1': Aborting launch.
出错的原因是没有创建android模拟器,不过按照google的android文档中的HelloAndroid例子那样的一步一步进行,这个错误是不会发生的。

如何创建Android模拟器,这是摘自Android文档的一段话:
[quote]
To create an AVD, use the "android" tool provided in the Android SDK. Open a command prompt or terminal, navigate to the tools/ directory in the SDK package and execute:
android create avd --target 2 --name my_avd
The tool now asks if you would like to create a custom hardware profile. For the time being, press Return to skip it ("no" is the default response). That's it. This configures an AVD named "my_avd" that uses the Android 1.5 platform. The AVD is now ready for use in the emulator.
In the above command, the --target option is required and specifies the deployment target to run on the emulator. The --name option is also required and defines the name for the new AVD.
[/quote]
大概意思是这样的:
使用Android开发工具中的android命令创建AVD(Android virtual devices)。打开系统命令提示窗口,将目录转移到Android安装目录中的tools下面,运行命令android create avd --target 2 --name my_avd,接下来会有一些设置,不用搭理,直接给个回车就行了(其中的target是android的id号,可以通过命令android list查询,name是创建模拟器的名字,自己随便给个)。

像这样创建了Android模拟器就不会在出错了。

如果使用过eclipse开发,这里还有更便捷的方法,点击eclipse工具栏中的手机符号
[img]http://dl.iteye.com/upload/attachment/141481/dc4e6f06-f1cb-3942-8cdd-ec3ebd67fe66.jpg[/img],将会弹出一个对话框如下,这里面就可以创建Android模拟器。
[img]http://dl.iteye.com/upload/attachment/141483/7e503023-d81f-3887-a121-45016e2dde75.jpg[/img]

[b]问题2:[/b]运行HelloAndroid时出现以下问题:

[color=red][2009-02-15 12:37:15 - HelloAndroid] ------------------------------
[2009-02-15 12:37:15 - HelloAndroid] Android Launch!
[2009-02-15 12:37:15 - HelloAndroid] adb is running normally.
[2009-02-15 12:37:15 - HelloAndroid] Launching: com.test.HelloAndroid
[2009-02-15 12:37:15 - HelloAndroid] Automatic Target Mode: launching new emulator.
[2009-02-15 12:37:15 - HelloAndroid] Launching a new emulator.
[2009-02-15 12:37:18 - HelloAndroid] New emulator found: emulator-5554
[2009-02-15 12:37:18 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched... [/color]

模拟器中没有出现期望中的界面,只显示“ANDROID ”,关掉模拟器后出现:

[color=red][2009-02-15 12:39:32 - HelloAndroid] emulator-5554 disconnected! Cancelling 'com.test.HelloAndroid' launch![/color]

哎,网上很多人都喊啊,这是问题,我自己还以为也是问题,弄了半天,结果什么不是,原来是大伙在吓自己。Android这个东西运行停慢的,那个上面的5554是连接的端口号,所以并不是什么错误信息,当它正在连接时,你突然把它给终止,当然会出现上面那个错误了。大伙耐心地等待几分钟就没问题了。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值