Andriod开发学习

导入手持机代码,发现的问题如下:

1、Android requires compiler compliance level 5.0 or 6.0. Found '1.4' instead. Please use Android Tools > Fix Project Properties.

原因:工程采用的是JDK1.6,我安装过1.7,是版本过高。切换回1.6即可。

解决方法:

  1. Project Properties -> java Compiler -> Enable project specific settings -> 再选择 Compiler Compliance Leave(1.6) -> OK
导入过程中,如果andriod版本不匹配会有如下提示: Unable to resolve target 'android-8'

工程会自动编译一个R.java.如果配置库代码异常,更新后自动编译导致R.java无边编译成功。可以先关闭自动编译,找到错误原因后修复。在Eclipse中禁用自动创建:Menu -> project- > Uncheck build automatically

关闭自动编译后发现如下错误:

[2012-06-21 17:19:52 - wsn_cbq_android] res\drawable\item_mainui_left_100.png:0: error: Resource entry item_mainui_left_100 is already defined.
[2012-06-21 17:19:52 - wsn_cbq_android] res\drawable\item_mainui_left_100.jpg:0: Originally defined here.
[2012-06-21 17:19:52 - wsn_cbq_android] res\drawable\item_option_menu.png:0: error: Resource entry item_option_menu is already defined.
[2012-06-21 17:19:52 - wsn_cbq_android] res\drawable\item_option_menu.jpg:0: Originally defined here.
[2012-06-21 17:19:52 - wsn_cbq_android] res\drawable\item_option_open.png:0: error: Resource entry item_option_open is already defined.
[2012-06-21 17:19:52 - wsn_cbq_android] res\drawable\item_option_open.jpg:0: Originally defined here.

原因是同名文件,虽然格式不同,但是生产的资源是冲突的。

andriod自动打包:

http://jojol-zhou.iteye.com/blog/729271


编译OK,虚拟机上执行时报错,找不到引入的第三方soap类。

试了半天 最后把第三主JAR包手在SRC目录下,add to buildpath 后OK了。然后再改成其他目录都OK。重新创建AVD也OK,奇怪。


手机上调试:

设置手机上USB调试。设置---应用程序---开发----usb调试,勾选。

最后,在eclipse中,Run (Debug)Configuration  选择 target 选下面的Manual 就会弹出选择是否用手机调试。


PC和模拟器之间拷贝文件:

adb push
adb pull
这是在命令行下

在eclipse上可以采用Android提供的file explorer
具体打开方式
windows->show view->other->Android->file explorer
或者在ddms下能直接看到file explorer


模拟器调试慢目前的解决方案是:
关闭模拟器自动侦测手机旋转的设置
具体位置为:设置 - 显示 - 关闭“自动旋转屏幕”的选项

其他方法:http://yubosun.akcms.com/tech/android-emulator-slow.htm


1、响应事件的为this,则处理函数为当前类的onclick()函数
 (findViewById(R.id.llMainUIBotton)).setOnClickListener(this);

2、messageHandler.sendMessage(message); 的响应函数是当前类的handleMessage函数

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值