<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>生活在远方 &#187; android</title>
	<atom:link href="http://www.rsywx.net/wordpress/tag/android/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rsywx.net/wordpress</link>
	<description>是的，因为真正的生活是在远方</description>
	<lastBuildDate>Wed, 08 Feb 2012 13:55:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Android: Instant Heart Rate</title>
		<link>http://www.rsywx.net/wordpress/2010/10/12/android-instant-heart-rate/</link>
		<comments>http://www.rsywx.net/wordpress/2010/10/12/android-instant-heart-rate/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 03:19:41 +0000</pubDate>
		<dc:creator>tr</dc:creator>
				<category><![CDATA[编程、软件、技术]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[heart rate]]></category>

		<guid isPermaLink="false">http://www.rsywx.net/wordpress/?p=2480</guid>
		<description><![CDATA[最近一直偏向于搞iPad，对于Android的程序有点不怎么关心了。不过，今天在网络上闲逛，看到这个软件：Instant Heart Rate，立即安装了一下。 这个程序，顾名思义，就是测量人的心率。 它的原理就是：“人体血液颜色是由血液中的含氧量决定的，而每次心跳都会使血液里的氧含量增加,身体消耗掉之后血液的氧含量又会降低，所以血液的颜色由于氧含量的变化会产生周期性的改变。当你的手指在手机摄像头前划过，手机程序就会观察血液颜色的变化然后做出较高精确地测量。这个程序相对传统检测方式来说，非常节约时间而且可以随时使用。” 我测量了几次，和我上次体检时的心率相比误差在±2之间，还是很准的。 这个软件非常实用，也有医学原理作为依据。前令狐，你值得拥有！]]></description>
			<content:encoded><![CDATA[<p>最近一直偏向于搞iPad，对于Android的程序有点不怎么关心了。不过，今天在网络上闲逛，看到这个软件：Instant Heart Rate，立即安装了一下。</p>
<p>这个程序，顾名思义，就是测量人的心率。</p>
<p>它的原理就是：“人体血液颜色是由血液中的含氧量决定的，而每次心跳都会使血液里的氧含量增加,身体消耗掉之后血液的氧含量又会降低，所以血液的颜色由于氧含量的变化会产生周期性的改变。当你的手指在手机摄像头前划过，手机程序就会观察血液颜色的变化然后做出较高精确地测量。这个程序相对传统检测方式来说，非常节约时间而且可以随时使用。”</p>
<p><a href="http://www.rsywx.net/wordpress/wp-content/uploads/2010/10/CAP201010121101.jpg"><img class="alignnone size-medium wp-image-2481" title="CAP201010121101" src="http://www.rsywx.net/wordpress/wp-content/uploads/2010/10/CAP201010121101-180x300.jpg" alt="" width="180" height="300" /></a></p>
<p>我测量了几次，和我上次体检时的心率相比误差在±2之间，还是很准的。</p>
<p>这个软件非常实用，也有医学原理作为依据。<strong>前令狐，你值得拥有！</strong></p>
<div style="float:left;margin:0px 0px 0px 0px;"><a title="Post on Google Buzz" class="google-buzz-button" href="http://www.google.com/buzz/post" data-button-style="normal-count" data-url="http://www.rsywx.net/wordpress/2010/10/12/android-instant-heart-rate/"></a><script type="text/javascript" src="http://www.google.com/buzz/api/button.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.rsywx.net/wordpress/2010/10/12/android-instant-heart-rate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How Nexus One changed my mobile life</title>
		<link>http://www.rsywx.net/wordpress/2010/06/28/how-nexus-one-changed-my-mobile-life/</link>
		<comments>http://www.rsywx.net/wordpress/2010/06/28/how-nexus-one-changed-my-mobile-life/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 11:39:30 +0000</pubDate>
		<dc:creator>tr</dc:creator>
				<category><![CDATA[编程、软件、技术]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[n1]]></category>
		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://www.rsywx.net/wordpress/2010/06/28/how-nexus-one-changed-my-mobile-life/</guid>
		<description><![CDATA[I have been using mobile phones for many years, but I just used it, not being influenced by it, until I got this one: Nexus One. The most application that I use on N1 is Email. Android 2.X supports Exchange accounts. This is really a must have for my office emails. How can I access [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using mobile phones for many years, but I just used it, not being influenced by it, until I got this one: Nexus One.</p>
<p>The most application that I use on N1 is Email. Android 2.X supports Exchange accounts. This is really a must have for my office emails. How can I access my office mails without a handy client, using web access? Come on, buddy, you must be kidding me.</p>
<p>The N1 Email client is just good enough for me: synchronization with my office email account, compose a quick reply on the fly. All are done transparently with some settings that are not those that can only be done by a veteran geek. This is good.</p>
<p>Also, it synchronizes my contacts, both in gmail.com and in my Exchange directory. This saves me a lot of time wondering where I should put my new contacts.</p>
<p>Of course, it has some fallbacks. First of all, it does not support a customized signature saying &#8220;Sent from my N1&#8243;. You know how much I envy when I read a message with a &#8220;Sent from my iPhone&#8221; or &#8220;Sent from my Blackberry&#8221; signature? I wish I could do that on my N1 and I am willing to pay for this simple feature! (p.s. I had done a search in Android Market and find this application which seems to fit my requirement: Touchdown. It will cost me $20 so I will keep on evaluating for another 29 days!)</p>
<p>Another frequently used application is my Twidroid (an Tweet-like client but connected to BT group&#8217;s own chat server running Status.net). With this application, I can stay tuned and online chatting with my buddies and get a catch on what is going on and share my findings.</p>
<p>There are also some other applications that I use almost equally often: Gmail, GTalk, Maps, Handcent SMS, 3banana, Camera.</p>
<p>These applications themselves are fully functional but the best part of it is that they are fully integated.</p>
<p>When I was in Zhangjiajie joining the company&#8217;s vacation, I opened 3banana and created a note and quickly wrote down my comments, opened up the camera to take a shot of the scenes that I would like to share, and then sync to my 3banana server, and finally, share it with my BT friends with Twidroid! If I were not not using an N1, I could only have done this many, many hours later and will be much more troublesome.</p>
<p>Another example. I used to keep two calendars: one for my office and another for my personal activities. This approach is not so good. Why should I keep two calendars when I am only available for one thing at one particular time slot?</p>
<p>With N1, I can seamlessly synchronize my calendar events with my Google Calendar (on web) and with the help of a simple standalone program running on my notebook, I can synchronize my calendar with my Outlook too! This has removed my last headache in combing two calendars.</p>
<p>Now I can accpet an appointment initiated from my colleagues in Outlook and after synchronization, within a few minutes, my N1 will show this event too; or I can create my home/personal events at home in my desktop&#8217;s Thunderbird application and after a few minutes, this entry will show up in my N1 and later (after synchronization) in my Outlook Calendar as well.</p>
<p>This is really fitting my needs.</p>
<p>Mobile phones was considered to be a tool only. But this tool is now getting stronger and changing my life style.</p>
<p>Before N1, I can hardly imagine that an old man as I am, an absolute non Gen-Y people, could adopt to these new stuffs so quickly and readily. I mean, I know these applications exist but I am not using them because a simple task is very much torn apart and will take my much intervene to make it happen.</p>
<p>N1 makes it cooler.</p>
<div style="float:left;margin:0px 0px 0px 0px;"><a title="Post on Google Buzz" class="google-buzz-button" href="http://www.google.com/buzz/post" data-button-style="normal-count" data-url="http://www.rsywx.net/wordpress/2010/06/28/how-nexus-one-changed-my-mobile-life/"></a><script type="text/javascript" src="http://www.google.com/buzz/api/button.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.rsywx.net/wordpress/2010/06/28/how-nexus-one-changed-my-mobile-life/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>An Android application with map</title>
		<link>http://www.rsywx.net/wordpress/2010/04/04/an-android-application-with-map/</link>
		<comments>http://www.rsywx.net/wordpress/2010/04/04/an-android-application-with-map/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 08:36:14 +0000</pubDate>
		<dc:creator>tr</dc:creator>
				<category><![CDATA[编程、软件、技术]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[map]]></category>

		<guid isPermaLink="false">http://www.rsywx.net/wordpress/2010/04/04/an-android-application-with-map/</guid>
		<description><![CDATA[I had read a few tutorials on how to develop an Android appication with map display. Today I had actually built one. I would like to summarize the key points/steps in making this application work. 1. First of all, get an Android Map API Key from Google. This actually involves two steps. Firstly, you will [...]]]></description>
			<content:encoded><![CDATA[<p>I had read a few tutorials on how to develop an Android appication with map display. Today I had actually built one. I would like to summarize the key points/steps in making this application work.</p>
<p>1. First of all, get an Android Map API Key from Google.</p>
<p>This actually involves two steps.</p>
<p>Firstly, you will have to create a key store to sign your Android application. This is quite easy and straightforward.</p>
<p>Secondly, apply an Android Map Key from Google: <a href="http://code.google.com/intl/zh-CN/android/maps-api-signup.html">http://code.google.com/intl/zh-CN/android/maps-api-signup.html</a>. To make this work, you have to know where is your key store file is located (as created in the above step) and also have the JDK tool named <strong>keytool</strong>. From the command line, type:</p>
<pre>   keytool -list -keystore the-path-to-your-key-store-file
</pre>
<p>It will prompt you to enter the password to the key store and will generate a MD5 finger print for this particular key store file. Copy this MD5 finger print to the above URI and Google will give you the Android Map API Key immediately. It is strongly suggested to save this Key information.</p>
<p>2. Create an Android application.</p>
<p><strong>Note:</strong> It must be created with target set to: &#8220;Google APIs&#8221;. You should not set the application target to &#8220;Android x.x&#8221; or it will not be running properly.</p>
<p><strong>Note:</strong> The target of the AVD that runs the map application must also be set to &#8220;Google APIs&#8221;.</p>
<p><a href="http://www.rsywx.net/wordpress/wp-content/uploads/2010/04/Android_target.jpg"><img style="width: 400px; height: 287px;" src="http://www.rsywx.net/wordpress/wp-content/uploads/2010/04/zrtn_002p2b58b771_tn.jpg" alt="" width="400" height="287" /></a></p>
<p>The coding of the application is actually quite simple. There are only two points to be highlighted:</p>
<p>1. The application must be granted ACCESS_FINE_LOCATION and ACCESS_INTERNET permissions;</p>
<p>2. The mapview controll used in the view must be provided with the API key generated in Step 1. It will look something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;com.google.android.maps.MapView</span></span>
<span style="color: #009900;">   <span style="color: #000066;">android:id</span>=<span style="color: #ff0000;">&quot;@+id/myMapView&quot;</span></span>
<span style="color: #009900;">   <span style="color: #000066;">android:layout_width</span>=<span style="color: #ff0000;">&quot;fill_parent&quot;</span></span>
<span style="color: #009900;">   <span style="color: #000066;">android:layout_height</span>=<span style="color: #ff0000;">&quot;fill_parent&quot;</span></span>
<span style="color: #009900;">   <span style="color: #000066;">android:enabled</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #009900;">   <span style="color: #000066;">android:clickable</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #009900;">   <span style="color: #000066;">android:apiKey</span>=<span style="color: #ff0000;">&quot;your api key here&quot;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>With these settings, the map application can eventually run successfully. However, in my implementation, the map shown in my AVD is only grids, no actuall maps at all. But in real machine (mine is Nexus One), the application is running correctly.</p>
<div style="float:left;margin:0px 0px 0px 0px;"><a title="Post on Google Buzz" class="google-buzz-button" href="http://www.google.com/buzz/post" data-button-style="normal-count" data-url="http://www.rsywx.net/wordpress/2010/04/04/an-android-application-with-map/"></a><script type="text/javascript" src="http://www.google.com/buzz/api/button.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.rsywx.net/wordpress/2010/04/04/an-android-application-with-map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Something to talk on iPhone and Android</title>
		<link>http://www.rsywx.net/wordpress/2010/03/17/something-to-talk-on-iphone-and-android/</link>
		<comments>http://www.rsywx.net/wordpress/2010/03/17/something-to-talk-on-iphone-and-android/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 02:09:15 +0000</pubDate>
		<dc:creator>tr</dc:creator>
				<category><![CDATA[编程、软件、技术]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://www.rsywx.net/wordpress/?p=2168</guid>
		<description><![CDATA[猛禽写了一篇关于iPhone和Android的开放问题的文章。我虽然近来难得看妓术技术文章，不过猛禽这篇我还是看了一遍。随便说说我的想法吧。 我最早接触电脑是用的Apple II，高中的时候在上面编程玩，编了一个图书馆的管理程序，用的是文本数据库，Basic语言。这个程序当年还获得了省二等奖。顺便说一句，当时用的中文系统是一个盗版的…… 在我看来，一个产品的成功（或者不成功）的原因很多，绝对不能简单的用操作系统、硬件、SDK的开放与否中的任意一个来解释，还必须加上特性、市场、用户群、应用等等方面。 ＝＝＝＝＝＝＝＝＝＝＝ 硬件的发展总是超出软件的发展。这有点像数学和物理的关系：数学中的矩阵运算应用到物理（确切地说是量子力学）中是很后期的事情，而且现在还有一个数学理论——数论——在物理中没也有找到应用的范畴。但是，在一般概念中，硬件的开发要比软件难的多，门槛也高的多。所以，一旦硬件平台成为标准，它大可以封闭起来。这里顺大便BS一下猛禽，在486年代，TI也还是出过CPU的，只是后来才专心做其它的专业芯片（比如投影机中的DLP芯片）。 软件的开发平台很难统一。从某种经典的理论来说，既然允许多样性，那么开放／不开放都有道理。用苹果的模式去强套谷歌没用，用谷歌的模式去强套苹果也不行。 ＝＝＝＝＝＝＝＝＝ 苹果到底是成功了的。猛禽说的对： 并不是因为它不开放而成功，而是因为在过去几年直到现在，水果在技术和创意上一直遥遥领先于竞争对 手。这一点为它带来了大量的用户，而足够多的用户才能吸引到足够多的开发者，开发出更多的应用则使它的领先优势进一步扩大，如此正反馈循环推动水果从成功 走向更加成功。 但是，千万不要忘记苹果在市场把握上的敏锐和独到。在我看来，苹果推出App Store才是iPhone最终横扫的重要原因。 从最终用户来看，在App Store上可以自由下载免费和收费不那么离谱的应用，从而十分个性化的定制自己的手机。在一个统一的外表下，蕴藏着无穷多的变异……在这个意义上说，每台iPhone都是独一无二的。 从开发者角度看，他们的工作终于可以得到“普遍”的承认了。即使没有真金白银的收入，也可以看到自己的程序下载量，知道这世界上有那么多人在用我的东西。更何况，还可以梦想日进斗金。 苹果敏锐的捕捉到了这个切入点：手机应用在起步阶段，需要有一个centralized的地方让大家来获得应用。这个地方不应该是ISP，不应该是Dwonload.com，更不应该是零零碎碎散布在全球N个站点上。作为iPhone的硬件和操作系统的制造者，Apple才是最合适、最合理、最自然的做这件事情的人。 我之前用过WM手机和Symbian手机，但是从来没有认真装过什么第三方应用。倒是在我最早使用Palm的时候，还装过一些软件——主要是因为Palm软件的破解非常容易……更不要说去开发软件了…… 从我个人而言，我比较喜欢Android的开发环境（无论是IDE还是SDK还是编程语言）。我个人是C／C＋＋出身，对Java有天生的亲近。]]></description>
			<content:encoded><![CDATA[<p>猛禽写了一篇关于<a href="http://blog.csdn.net/Raptor/archive/2010/03/12/5373733.aspx">iPhone和Android的开放问题</a>的文章。我虽然近来难得看<span style="text-decoration: line-through;">妓术</span>技术文章，不过猛禽这篇我还是看了一遍。随便说说我的想法吧。</p>
<p>我最早接触电脑是用的Apple II，高中的时候在上面编程玩，编了一个图书馆的管理程序，用的是文本数据库，Basic语言。这个程序当年还获得了省二等奖。顺便说一句，当时用的中文系统是一个盗版的……</p>
<p>在我看来，一个产品的成功（或者不成功）的原因很多，绝对不能简单的用操作系统、硬件、SDK的开放与否中的任意一个来解释，还必须加上特性、市场、用户群、应用等等方面。</p>
<p>＝＝＝＝＝＝＝＝＝＝＝</p>
<p><span id="more-2168"></span>硬件的发展总是超出软件的发展。这有点像数学和物理的关系：数学中的矩阵运算应用到物理（确切地说是量子力学）中是很后期的事情，而且现在还有一个数学理论——数论——在物理中没也有找到应用的范畴。但是，在一般概念中，硬件的开发要比软件难的多，门槛也高的多。所以，一旦硬件平台成为标准，它大可以封闭起来。这里顺大便BS一下猛禽，在486年代，TI也还是出过CPU的，只是后来才专心做其它的专业芯片（比如投影机中的DLP芯片）。</p>
<p>软件的开发平台很难统一。从某种经典的理论来说，既然允许多样性，那么开放／不开放都有道理。用苹果的模式去强套谷歌没用，用谷歌的模式去强套苹果也不行。</p>
<p>＝＝＝＝＝＝＝＝＝</p>
<p>苹果到底是成功了的。猛禽说的对：</p>
<blockquote><p>并不是因为它不开放而成功，而是因为在过去几年直到现在，水果在技术和创意上一直遥遥领先于竞争对 手。这一点为它带来了大量的用户，而足够多的用户才能吸引到足够多的开发者，开发出更多的应用则使它的领先优势进一步扩大，如此正反馈循环推动水果从成功 走向更加成功。</p></blockquote>
<p>但是，千万不要忘记苹果在市场把握上的敏锐和独到。在我看来，苹果推出App Store才是iPhone最终横扫的重要原因。</p>
<p>从最终用户来看，在App Store上可以自由下载免费和收费不那么离谱的应用，从而十分个性化的定制自己的手机。在一个统一的外表下，蕴藏着无穷多的变异……在这个意义上说，每台iPhone都是独一无二的。</p>
<p>从开发者角度看，他们的工作终于可以得到“普遍”的承认了。即使没有真金白银的收入，也可以看到自己的程序下载量，知道这世界上有那么多人在用我的东西。更何况，还可以梦想日进斗金。</p>
<p>苹果敏锐的捕捉到了这个切入点：手机应用在起步阶段，需要有一个centralized的地方让大家来获得应用。这个地方不应该是ISP，不应该是Dwonload.com，更不应该是零零碎碎散布在全球N个站点上。作为iPhone的硬件和操作系统的制造者，Apple才是最合适、最合理、最自然的做这件事情的人。</p>
<p>我之前用过WM手机和Symbian手机，但是从来没有认真装过什么第三方应用。倒是在我最早使用Palm的时候，还装过一些软件——主要是因为Palm软件的破解非常容易……更不要说去开发软件了……</p>
<p>从我个人而言，我比较喜欢Android的开发环境（无论是IDE还是SDK还是编程语言）。我个人是C／C＋＋出身，对Java有天生的亲近。</p>
<div style="float:left;margin:0px 0px 0px 0px;"><a title="Post on Google Buzz" class="google-buzz-button" href="http://www.google.com/buzz/post" data-button-style="normal-count" data-url="http://www.rsywx.net/wordpress/2010/03/17/something-to-talk-on-iphone-and-android/"></a><script type="text/javascript" src="http://www.google.com/buzz/api/button.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.rsywx.net/wordpress/2010/03/17/something-to-talk-on-iphone-and-android/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>用Nexus One来写WordPress的博客</title>
		<link>http://www.rsywx.net/wordpress/2010/02/27/posting-wordpress-blog-with-nexus-one/</link>
		<comments>http://www.rsywx.net/wordpress/2010/02/27/posting-wordpress-blog-with-nexus-one/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 16:07:20 +0000</pubDate>
		<dc:creator>tr</dc:creator>
				<category><![CDATA[编程、软件、技术]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[compatibility]]></category>
		<category><![CDATA[nexus one]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp2laconica]]></category>
		<category><![CDATA[兼容]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://www.rsywx.net/wordpress/?p=2126</guid>
		<description><![CDATA[刚入手的N1，于是自然而然开始试用各类软件。这篇文章就是用Wordpress for Android写的。还行！ 只是它和WP2Laconica插件不兼容。如果选择在Wordpress for Android中“Publish”的话，会crash这个软件。但是post已经成功发布，只是由WP2Laconic创建的uri会不完整，而push到我的话痨站点的推也会不完整。 已经向WP官方报告了这个问题。 我个人认为，这个问题不算太大——毕竟用手机写博客很累，而如果真有这样的情况，先放一个draft上去也是不错的做法。]]></description>
			<content:encoded><![CDATA[<p>刚入手的N1，于是自然而然开始试用各类软件。这篇文章就是用Wordpress for Android写的。还行！</p>
<p>只是它和WP2Laconica插件不兼容。如果选择在Wordpress for Android中“Publish”的话，会crash这个软件。但是post已经成功发布，只是由WP2Laconic创建的uri会不完整，而push到我的话痨站点的推也会不完整。</p>
<p>已经向WP官方报告了这个问题。</p>
<p>我个人认为，这个问题不算太大——毕竟用手机写博客很累，而如果真有这样的情况，先放一个draft上去也是不错的做法。</p>
<div style="float:left;margin:0px 0px 0px 0px;"><a title="Post on Google Buzz" class="google-buzz-button" href="http://www.google.com/buzz/post" data-button-style="normal-count" data-url="http://www.rsywx.net/wordpress/2010/02/27/posting-wordpress-blog-with-nexus-one/"></a><script type="text/javascript" src="http://www.google.com/buzz/api/button.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.rsywx.net/wordpress/2010/02/27/posting-wordpress-blog-with-nexus-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello, My Android（三）</title>
		<link>http://www.rsywx.net/wordpress/2008/11/12/hello-my-android%ef%bc%88%e4%b8%89%ef%bc%89/</link>
		<comments>http://www.rsywx.net/wordpress/2008/11/12/hello-my-android%ef%bc%88%e4%b8%89%ef%bc%89/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 11:40:15 +0000</pubDate>
		<dc:creator>tr</dc:creator>
				<category><![CDATA[编程、软件、技术]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[事件]]></category>

		<guid isPermaLink="false">http://www.rsywx.net/wordpress/?p=1150</guid>
		<description><![CDATA[界面设计完成后，我要开始为那个Button的单击事件设计响应函数。 在Android中，事件的设计也很诡异。我们先来看代码： public class HelloMyAndroid extends Activity { /** Called when the activity is first created. */ public static int counter=0; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button btnClickMe=(Button)findViewById(R.id.btnClickMe); btnClickMe.setOnClickListener(new View.OnClickListener(){ public void onClick(View view) { TextView lbl=(TextView)findViewById(R.id.lblHello); Date d=new Date(); Formatter f=new Formatter(); f.format("You clicked me on %s for %d time(s).", d.toGMTString(), [...]]]></description>
			<content:encoded><![CDATA[<p>界面设计完成后，我要开始为那个Button的单击事件设计响应函数。</p>
<p>在Android中，事件的设计也很诡异。我们先来看代码：</p>
<p><span id="more-1150"></span></p>
<pre>public class HelloMyAndroid extends Activity {
    /** Called when the activity is first created. */
	public static int counter=0;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Button btnClickMe=(Button)findViewById(R.id.btnClickMe);
        btnClickMe.setOnClickListener(new View.OnClickListener(){
        	public void onClick(View view)
        	{
        		TextView lbl=(TextView)findViewById(R.id.lblHello);
        		Date d=new Date();
        		Formatter f=new Formatter();

        		f.format("You clicked me on %s for %d time(s).", d.toGMTString(), ++counter);
        		lbl.setText(f.toString());
        	}
        });
    }
}</pre>
<p>很奇怪吧。在OnCreate事件中连接事件响应还是可以理解的，而这个Listener直接用inline class来实现至少对我来说很少见。我更习惯用一个成员函数来处理。这点还需要更进一步的研究。</p>
<p>其它的代码并没有什么技术含量。每次点击那个按钮后，就显示“你在什么时候点了按钮几次”而已。</p>
<p>两点需要说明：</p>
<ul>
<li>如果我们运行程序，点击几次后用手机上的Home或者Back按钮回到主界面，然后再次运行这个程序，我们会发现，程序并没有显示原始的标签，而还是显示“你在什么时候点了按钮几次”，并且，继续点击按钮时，counter会正确的计数。这是因为，用Home或者Back回到主界面并没有关闭这个程序。这个程序还在后台运行。</li>
<li>f.format中用到的格式化字符串还是嵌入在程序代码中的，并没有放置到资源中然后再取出。这个问题我还没有解决。</li>
</ul>
<p>============</p>
<p>第一个程序的开发先暂时如此。总结一下：</p>
<ol>
<li>代码比较清晰明了。资源、代码等的分离可以免除一些不必要的麻烦；</li>
<li>速度运行的很快，至少在我的模拟器上；</li>
<li>事件响应的映射还比较自然、合理；</li>
<li>对中文的处理非常好（当然，在模拟器中还无法输入中文），中文显示没有任何问题。</li>
</ol>
<p>下一个程序，将显示两个界面之间的转换……</p>
<div style="float:left;margin:0px 0px 0px 0px;"><a title="Post on Google Buzz" class="google-buzz-button" href="http://www.google.com/buzz/post" data-button-style="normal-count" data-url="http://www.rsywx.net/wordpress/2008/11/12/hello-my-android%ef%bc%88%e4%b8%89%ef%bc%89/"></a><script type="text/javascript" src="http://www.google.com/buzz/api/button.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.rsywx.net/wordpress/2008/11/12/hello-my-android%ef%bc%88%e4%b8%89%ef%bc%89/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hello, My Android（二）</title>
		<link>http://www.rsywx.net/wordpress/2008/11/10/hello-my-android%ef%bc%88%e4%ba%8c%ef%bc%89/</link>
		<comments>http://www.rsywx.net/wordpress/2008/11/10/hello-my-android%ef%bc%88%e4%ba%8c%ef%bc%89/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 12:27:02 +0000</pubDate>
		<dc:creator>tr</dc:creator>
				<category><![CDATA[编程、软件、技术]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[界面]]></category>

		<guid isPermaLink="false">http://www.rsywx.net/wordpress/?p=1142</guid>
		<description><![CDATA[接下来，我们继续看属于LinearLayout的子控件的两个控件：TextView和Button。有关Android界面中可以用到的Widget有哪些我会在以后再描述。 =================== TextView的声明为： &#60;TextView android:id="@+id/lblHello" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /&#62; 这里，需要注意两个地方。每个Widget需要有一个id来标识自己，同时也可以为日后的操作提供一个标志符号。这里，我采用的定义是@+id/lblHello。它表示，我定义一个id，名字是lblHello，同时如果这个id还不存在，那么就创建这个id；另外，这个Widget的text是@string/hello，这表示我希望用string类型的资源中名称为hello的字符串的内容作为我这个标签的文本。这里并不提倡使用静态文本，因为这样做对将来的i18n不利。 &#60;Button&#62;的定义与之类似。这里不再重复说明。 =============== main.xml一旦保存后，Eclipse/Android项目会自动更新R.java文件，其中就会包含我们已经定义好的一些标识符和对应的常量。例如： public static final class id { public static final int btnClickMe=0x7f050001; public static final int lblHello=0x7f050000; } 同时，我们可以看看string.xml文件，看里面有些什么： &#60;string name="hello"&#62;Hello, My Android!&#60;/string&#62; &#60;string name="app_name"&#62;你好，我的Android！&#60;/string&#62; &#60;string name="btn_click_me"&#62;Click Me!&#60;/string&#62; &#60;string name="str_output"&#62;You clicked me on %s for %d time(s).&#60;/string&#62; 这里，有些字符串的定义已经出现了，有些还没有出现。不要紧，在后面的编程中，我们会看到的。 我们已经有了界面后，需要做的事情就是进行事件的响应和处理。 它的界面效果是这样的： （未完待续）]]></description>
			<content:encoded><![CDATA[<p>接下来，我们继续看属于LinearLayout的子控件的两个控件：TextView和Button。有关Android界面中可以用到的Widget有哪些我会在以后再描述。</p>
<p>===================</p>
<p><span id="more-1142"></span></p>
<p>TextView的声明为：</p>
<pre>&lt;TextView
    android:id="@+id/lblHello"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/hello"
    /&gt;</pre>
<p>这里，需要注意两个地方。每个Widget需要有一个id来标识自己，同时也可以为日后的操作提供一个标志符号。这里，我采用的定义是@+id/lblHello。它表示，我定义一个id，名字是lblHello，同时如果这个id还不存在，那么就创建这个id；另外，这个Widget的text是@string/hello，这表示我希望用string类型的资源中名称为hello的字符串的内容作为我这个标签的文本。这里并不提倡使用静态文本，因为这样做对将来的i18n不利。</p>
<p>&lt;Button&gt;的定义与之类似。这里不再重复说明。</p>
<p>===============</p>
<p>main.xml一旦保存后，Eclipse/Android项目会自动更新R.java文件，其中就会包含我们已经定义好的一些标识符和对应的常量。例如：</p>
<pre>public static final class id {
    public static final int btnClickMe=0x7f050001;
    public static final int lblHello=0x7f050000;
}</pre>
<p>同时，我们可以看看string.xml文件，看里面有些什么：</p>
<pre>&lt;string name="hello"&gt;Hello, My Android!&lt;/string&gt;
&lt;string name="app_name"&gt;你好，我的Android！&lt;/string&gt;
&lt;string name="btn_click_me"&gt;Click Me!&lt;/string&gt;
&lt;string name="str_output"&gt;You clicked me on %s for %d time(s).&lt;/string&gt;</pre>
<p>这里，有些字符串的定义已经出现了，有些还没有出现。不要紧，在后面的编程中，我们会看到的。</p>
<p>我们已经有了界面后，需要做的事情就是进行事件的响应和处理。</p>
<p>它的界面效果是这样的：</p>
<div id="attachment_1145" class="wp-caption alignnone" style="width: 166px"><a href="http://www.rsywx.net/wordpress/wp-content/uploads/2008/11/hellomyandroid.jpg"><img class="size-medium wp-image-1145" title="hellomyandroid" src="http://www.rsywx.net/wordpress/wp-content/uploads/2008/11/hellomyandroid-156x300.jpg" alt="HelloMyAndroid的界面" width="156" height="300" /></a><p class="wp-caption-text">HelloMyAndroid的界面</p></div>
<p>（未完待续）</p>
<div style="float:left;margin:0px 0px 0px 0px;"><a title="Post on Google Buzz" class="google-buzz-button" href="http://www.google.com/buzz/post" data-button-style="normal-count" data-url="http://www.rsywx.net/wordpress/2008/11/10/hello-my-android%ef%bc%88%e4%ba%8c%ef%bc%89/"></a><script type="text/javascript" src="http://www.google.com/buzz/api/button.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.rsywx.net/wordpress/2008/11/10/hello-my-android%ef%bc%88%e4%ba%8c%ef%bc%89/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello, My Android!（一）</title>
		<link>http://www.rsywx.net/wordpress/2008/11/09/hello-my-android%ef%bc%88%e4%b8%80%ef%bc%89/</link>
		<comments>http://www.rsywx.net/wordpress/2008/11/09/hello-my-android%ef%bc%88%e4%b8%80%ef%bc%89/#comments</comments>
		<pubDate>Sun, 09 Nov 2008 11:47:03 +0000</pubDate>
		<dc:creator>tr</dc:creator>
				<category><![CDATA[编程、软件、技术]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[emulator]]></category>

		<guid isPermaLink="false">http://www.rsywx.net/wordpress/?p=1117</guid>
		<description><![CDATA[我想，部分是受到了山寨机也即将支持Android的鼓舞，最近我下载了一套Eclipse Ganymede+Android SDK，开始看看在这套著名的API下开发Android应用会是怎样的体验。 不是说以前没有尝试过开发手机下的应用。比如，在我04年用Palm的时候，06年用WM的时候，08年用Symbian的时候……不过都可耻滴放弃了： 放弃Palm是因为它的开发理念和我习惯的事件驱动相差实在太远； 放弃WM是因为那时（包括现在）很BSMS； 放弃Symbian是因为我有一个朋友开的公司将Symbian开发做到了极致，我肯定超不过他的水平…… 好吧，让我来看看Android…… =================== 当然，如何设置ADT（Android Eclipse Plugin）我就不说了（什么，你不知道怎么玩Eclipse？这个这个……）；怎么用Wizard来创建基本的框架我也不多说了。我只说说接下来我做的事情。 首先，我先创建了一个Run的配置，然后就开始运行。Android模拟器顺利的启动了，新创建的项目也顺利执行。然后我开始看整个项目的结构： HelloMyAndroid ├─assets ├─bin │ └─com │ └─android │ └─tr │ └─testcase ├─res │ ├─drawable │ ├─layout │ └─values └─src └─com └─android └─tr └─testcase 在这个结构中： assets目录目前是空的，我也暂时先不管这个目录派什么用场。不过从英文名可以推测是放置一些“有用的东西”； bin目录下有三个文件：classes.dex, HelloMyAndroid.apk, resources.ap_。根据说明，这个apk文件就是以后安装应用程序到手机上时需要使用的打包文件； bin目录下还有一个很深的目录结构，它其实代表了我创建这个程序时所选择的包：com.android.tr.testcase。在testcase目录下是编译好的class文件。 res目录下给出了Android程序中最常用的三种资源：drawable，layout，values。在drawable目录中只有一个icon.png，这个图标会成为我们程序的图标；layout目录中目前只有一个main.xml，在这个xml文件中，描述了程序界面——应该说，用xml描述界面没有什么不对的，但是如果没有一个GUI来辅助用户设计界面是8HD的；values目录中有一个strings.xml文件，这里保存着程序中使用到的字符串（你当然可以选择不用这种方式来保存、使用字符串，但是会失去i18n的灵活性）。 src目录下，又是一个对应于我开发这个程序时所选择的包的路径。在testcase目录下，有两个文件：一个是HelloMyAndroid.java，一个是R.java。前者当然是我编写的源文件，而后者是根据res目录中资源的情况自动生成的一个资源-ID对照表。 ================= 由于我准备在一个很常规的Hello World程序中增加一些新东西，所以我第一步就开始修改界面。为此，我修改了res/layout/main.xml： &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" [...]]]></description>
			<content:encoded><![CDATA[<p>我想，部分是受到了山寨机也即将支持Android的鼓舞，最近我下载了一套Eclipse Ganymede+Android SDK，开始看看在这套著名的API下开发Android应用会是怎样的体验。</p>
<p>不是说以前没有尝试过开发手机下的应用。比如，在我04年用Palm的时候，06年用WM的时候，08年用Symbian的时候……不过都可耻滴放弃了：</p>
<ul>
<li>放弃Palm是因为它的开发理念和我习惯的事件驱动相差实在太远；</li>
<li>放弃WM是因为那时（包括现在）很BSMS；</li>
<li>放弃Symbian是因为我有一个朋友开的公司将Symbian开发做到了极致，我肯定超不过他的水平……</li>
</ul>
<p>好吧，让我来看看Android……</p>
<p>===================</p>
<p><span id="more-1117"></span></p>
<p>当然，如何设置ADT（Android Eclipse Plugin）我就不说了（什么，你不知道怎么玩Eclipse？这个这个……）；怎么用Wizard来创建基本的框架我也不多说了。我只说说接下来我做的事情。</p>
<p>首先，我先创建了一个Run的配置，然后就开始运行。Android模拟器顺利的启动了，新创建的项目也顺利执行。然后我开始看整个项目的结构：</p>
<pre>HelloMyAndroid
├─assets
├─bin
│  └─com
│      └─android
│          └─tr
│              └─testcase
├─res
│  ├─drawable
│  ├─layout
│  └─values
└─src
    └─com
        └─android
            └─tr
                └─testcase</pre>
<p>在这个结构中：</p>
<ul>
<li>assets目录目前是空的，我也暂时先不管这个目录派什么用场。不过从英文名可以推测是放置一些“有用的东西”；</li>
<li>bin目录下有三个文件：classes.dex, HelloMyAndroid.apk, resources.ap_。根据说明，这个apk文件就是以后安装应用程序到手机上时需要使用的打包文件；</li>
<li>bin目录下还有一个很深的目录结构，它其实代表了我创建这个程序时所选择的包：com.android.tr.testcase。在testcase目录下是编译好的class文件。</li>
<li>res目录下给出了Android程序中最常用的三种资源：drawable，layout，values。在drawable目录中只有一个icon.png，这个图标会成为我们程序的图标；layout目录中目前只有一个main.xml，在这个xml文件中，描述了程序界面——应该说，用xml描述界面没有什么不对的，但是如果没有一个GUI来辅助用户设计界面是8HD的；values目录中有一个strings.xml文件，这里保存着程序中使用到的字符串（你当然可以选择不用这种方式来保存、使用字符串，但是会失去i18n的灵活性）。</li>
<li>src目录下，又是一个对应于我开发这个程序时所选择的包的路径。在testcase目录下，有两个文件：一个是HelloMyAndroid.java，一个是R.java。前者当然是我编写的源文件，而后者是根据res目录中资源的情况自动生成的一个资源-ID对照表。</li>
</ul>
<p>=================</p>
<p>由于我准备在一个很常规的Hello World程序中增加一些新东西，所以我第一步就开始修改界面。为此，我修改了res/layout/main.xml：</p>
<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                    android:orientation="vertical"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
&gt;
    &lt;TextView
        android:id="@+id/lblHello"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/hello"
    /&gt;
    &lt;Button
        android:id="@+id/btnClickMe"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/btn_click_me"
    /&gt;
&lt;/LinearLayout&gt;</pre>
<p>我选择使用LinearLayout来线性安排我的控件（在Android中称为“Widget”），而android:orientation=&#8221;vertical&#8221;表示这个布局将是竖直方向的；android:layout_width=&#8221;fill_parent&#8221;和android:layout_height=&#8221;fill_parent&#8221;表示这个布局的宽度、高度都将填充整个父控件的空间（这里就是整个屏幕）。</p>
<p>（未完待续）</p>
<div style="float:left;margin:0px 0px 0px 0px;"><a title="Post on Google Buzz" class="google-buzz-button" href="http://www.google.com/buzz/post" data-button-style="normal-count" data-url="http://www.rsywx.net/wordpress/2008/11/09/hello-my-android%ef%bc%88%e4%b8%80%ef%bc%89/"></a><script type="text/javascript" src="http://www.google.com/buzz/api/button.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.rsywx.net/wordpress/2008/11/09/hello-my-android%ef%bc%88%e4%b8%80%ef%bc%89/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

