摘要: 为了建立android的开发环境,刚安装了一个Ubuntu 10.10 32-bit,记录下建立android 2.2开发环境的过程和解决的问题。准备下载环境参照官方网站准备下载环境准备JDK和Eclipsefroyo最新版的build已经不需要JDK1.5了,直接下载一个linux 32-bit的JDK1.6就行。不太喜欢Ubuntu支持JDK/Eclipse带来的新问题,因此直接下载jdk-6u22-linux-i586.bin并在/opt目录运行安装,为了简单,我把安装后的目录换名jdk1.6。Eclipse一定要下载Java EE版本,因为ADT插件的build需要。我下载的是3.5. 阅读全文
posted @ 2011-01-21 13:21 Lorcan.Luo 阅读(762) 评论(0) 推荐(0) 编辑
摘要: 原文:http://xstream.codehaus.org/tutorial.htmlTwo Minute TutorialThis is a very quick introduction to XStream. Skim read it to get an idea of how simple it is to convert objects to XML and back again. I'm sure you'll have questions afterwards.Create classes to be serializedHere's a couple of simple cl 阅读全文
posted @ 2011-01-21 13:05 Lorcan.Luo 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 原文:http://www.javaeye.com/topic/827513;SDK:http://developer.android.com/reference/android/os/AsyncTask.html;在开发Android应用时必须遵守单线程模型的原则: Android UI操作并不是线程安全的并且这些操作必须在UI线程中执行。在单线程模型中始终要记住两条法则:1. 不要阻塞UI线程2. 确保只在UI线程中访问Android UI工具包 当一个程序第一次启动时,Android会同时启动一个对应的主线程(Main Thread),主线程主要负责处理与UI相关的事件,如:用户的按键事 阅读全文
posted @ 2011-01-21 13:05 Lorcan.Luo 阅读(548) 评论(0) 推荐(0) 编辑
摘要: 原文(http://www.cnmsdn.com/html/201008/1282820368ID7725.html)Android提供了Invalidate方法实现界面刷新,但是Invalidate不能直接在线程中调用,因为他是违背了单线程模型:Android UI操作并不是线程安全的,并且这些操作必须在UI线程中调用。  Android程序中可以使用的界面刷新方法有两种,分别是利用Handler和利用postInvalidate()来实现在线程中刷新界面。  利用Handler刷新界面  实例化一个Handler对象,并重写handleMessage方法调用invalidate()实现界面 阅读全文
posted @ 2011-01-21 13:04 Lorcan.Luo 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 编写高效的Android代码(原文:http://www.chinaup.org/docs/toolbox/performance.html)毫无疑问,基于Android平台的设备一定是嵌入式设备。现代的手持设备不仅仅是一部电话那么简单,它还是一个小型的手持电脑,但是,即使是最快的最高端的手持设备也远远比不上一个中等性能的桌面机。这就是为什么在编写Android程序时要时刻考虑执行的效率,这些系统不是想象中的那么快,并且你还要考虑它电池的续航能力。这就意味着没有多少剩余空间给你去浪费了,因此,在你写Android程序的时候,要尽可能的使你的代码优化而提高效率。本页介绍了几种可以让开发者的And 阅读全文
posted @ 2011-01-21 13:03 Lorcan.Luo 阅读(463) 评论(0) 推荐(0) 编辑
摘要: Use Android WebView and Google Chart API to display dataMarch 18th, 2010转载 Google chart tool is a great tool to visualize data, you can easily to do HTTP GET or POST to get the chart image. And on Android we can use WebView to display Google chart in very easy steps.1, Put the WebView inside the l 阅读全文
posted @ 2011-01-21 13:02 Lorcan.Luo 阅读(856) 评论(0) 推荐(0) 编辑
摘要: 1. 首先先要获取你的debug keystore位置:打开Eclipse---Windows---Preferences---Android---Build查看默认的debug keystore位置,我的是C:\Documents and Settings\MYNAME \.android\debug.keystore(这个KEy,其实是自己签名的key,不一定要是这个。)2. 在cmd中执行:双引号中的为你keystore位置, 注意,你的双引号一定要有,否则就会报错:keytool error: java.lang.RuntimeException: Usage error, a 阅读全文
posted @ 2011-01-21 13:00 Lorcan.Luo 阅读(134) 评论(0) 推荐(0) 编辑
摘要: XML:?xml version="1.0" encoding="utf-8"?LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" TextView android:layout_width="fill_parent" android:layout_height="wrap_content" 阅读全文
posted @ 2011-01-21 12:52 Lorcan.Luo 阅读(787) 评论(0) 推荐(0) 编辑