导入手持机代码,发现的问题如下:
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即可。
解决方法:
- Project Properties -> java Compiler -> Enable project specific settings -> 再选择 Compiler Compliance Leave(1.6) -> OK
关闭自动编译后发现如下错误:
[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函数