﻿<?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>Code our life</title>
	<atom:link href="http://www.learnenjoy.cn/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.learnenjoy.cn/blog</link>
	<description>日日行，不怕千万里；时时学，不怕千万卷</description>
	<lastBuildDate>Wed, 01 Sep 2010 05:27:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Android Webview example-part 1</title>
		<link>http://www.learnenjoy.cn/blog/?p=640729</link>
		<comments>http://www.learnenjoy.cn/blog/?p=640729#comments</comments>
		<pubDate>Wed, 01 Sep 2010 05:23:07 +0000</pubDate>
		<dc:creator>Captain</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[webview]]></category>
		<category><![CDATA[浏览器]]></category>
		<category><![CDATA[超链接]]></category>
		<category><![CDATA[链接]]></category>

		<guid isPermaLink="false">http://www.learnenjoy.cn/blog/?p=640729</guid>
		<description><![CDATA[【翻译】Android WebView 实例（一） 原文：http://www.androidpeople.com/android-webview-example-part-1/ Webview主要用于在我们的程序中加载一段html内容。我们将分几个部分来讨论。在第一部分我们在程序中使用webview来加载一个普通的网页。LoadUrl是把网页加载到webview控件中的主要方法，所以我们使用下面的代码片段来加载一个网页 1 2 3 4 5 6 7 8 9 10 11 12 // WebViewExample.java public class WebViewExample extends Activity &#123; @Override public void onCreate&#40;Bundle savedInstanceState&#41; &#123; super.onCreate&#40;savedInstanceState&#41;; setContentView&#40;R.layout.main&#41;; WebView webView = &#40;WebView&#41; findViewById&#40;R.id.webview&#41;; webView.getSettings&#40;&#41;.setJavaScriptEnabled&#40;true&#41;; webView.loadUrl&#40;&#34;http://www.androidpeople.com&#34;&#41;; webView.setWebViewClient&#40;new HelloWebViewClient&#40;&#41;&#41;; &#125; &#125; 可是使用上面的方法，在程序中点击网页链接的时候，会使用android系统默认的浏览器来打开。为了解决这个问题，我们可以使用 shouldOverrideUrlLoading()方法和它的两个参数：webview和url。现在就可以在程序中打开网页链接了。 1 2 3 4 5 6 7 8 9 [...]]]></description>
		<wfw:commentRss>http://www.learnenjoy.cn/blog/?feed=rss2&amp;p=640729</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Navigation like Themify Page</title>
		<link>http://www.learnenjoy.cn/blog/?p=640723</link>
		<comments>http://www.learnenjoy.cn/blog/?p=640723#comments</comments>
		<pubDate>Thu, 19 Aug 2010 04:50:45 +0000</pubDate>
		<dc:creator>Captain</dc:creator>
				<category><![CDATA[JavascriPt]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[fontend]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[fadeIn]]></category>
		<category><![CDATA[fadeOut]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[themify]]></category>

		<guid isPermaLink="false">http://www.learnenjoy.cn/blog/?p=640723</guid>
		<description><![CDATA[仿Themify首页的导航效果 无意中了解到Themify这个网站，看到首页的导航效果挺漂亮（实话说，主要是图片够漂亮），就仿造了一个。 点击查看demo PS:这个demo没有什么技术含量，纯属做个记录。图片和css基本上是直接从Themify中copy过来的，js效果是自己实现，核心代码如下： // 代码不多，加上没有什么技术含量，不做注释 var $contents = $&#40;'#slider .slides'&#41;; var $navs = $&#40;'#slider .slider-nav li'&#41;; $navs.click&#40;function&#40;&#41;&#123; var $this = $&#40;this&#41;; $this.siblings&#40;&#41;.find&#40;'a'&#41;.attr&#40;'class', ''&#41;; $&#40;'a', this&#41;&#91;0&#93;.className = 'activeSlide'; var index = $navs.index&#40;$this&#41;; var $content = $contents.find&#40;'li'&#41;.eq&#40;index&#41;; $content.fadeIn&#40;&#41;; $content.siblings&#40;&#41;.fadeOut&#40;&#41;; return false; &#125;&#41;;]]></description>
		<wfw:commentRss>http://www.learnenjoy.cn/blog/?feed=rss2&amp;p=640723</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set the environment path of linux</title>
		<link>http://www.learnenjoy.cn/blog/?p=640719</link>
		<comments>http://www.learnenjoy.cn/blog/?p=640719#comments</comments>
		<pubDate>Tue, 17 Aug 2010 15:24:34 +0000</pubDate>
		<dc:creator>Captain</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[classpath]]></category>
		<category><![CDATA[environment]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[java_home]]></category>
		<category><![CDATA[path]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[环境变量]]></category>

		<guid isPermaLink="false">http://www.learnenjoy.cn/blog/?p=640719</guid>
		<description><![CDATA[环境变量配置文件 在Ubuntu中有如下几个文件可以设置环境变量 1、/etc/profile:在登录时,操作系统定制用户环境时使用的第一个文件,此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行。 2、/etc/environment:在登录时操作系统使用的第二个文件,系统在读取你自己的profile前,设置环境文件的环境变量。 3、~/.bash_profile:在登录时用到的第三个文件是.profile文件,每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该 文件仅仅执行一次!默认情况下,他设置一些环境变游戏量,执行用户的.bashrc文件。/etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取. 4、~/.bashrc:该文件包含专用于你的bash shell的bash信息,当登录时以及每次打开新的shell时,该该文件被读取。 以上文字来自：http://blog.csdn.net/xiaosu_521/archive/2008/03/09/2160458.aspx 比如要设置java jdk的环境变量： JAVA_HOME=/usr/java/jdk1.6.0_21 #指定JAVA_HOME所指向的目录，即java jdk所在的目录 PATH=$JAVA_HOME/bin:$PATH #将JAVA_HOME添加到PATH环境变量中 CLASSPATH=.:$JAVA_HOME/lib #设置CLASSPATH所指向的目录 export JAVA_HOME PATH CLASSPATH 添加变量之后使用命令更新: source /etc/profile]]></description>
		<wfw:commentRss>http://www.learnenjoy.cn/blog/?feed=rss2&amp;p=640719</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Life Circle of Android Activity</title>
		<link>http://www.learnenjoy.cn/blog/?p=640715</link>
		<comments>http://www.learnenjoy.cn/blog/?p=640715#comments</comments>
		<pubDate>Sat, 14 Aug 2010 10:59:39 +0000</pubDate>
		<dc:creator>Captain</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[未分类]]></category>
		<category><![CDATA[activity]]></category>
		<category><![CDATA[life-circle]]></category>
		<category><![CDATA[生命周期]]></category>

		<guid isPermaLink="false">http://www.learnenjoy.cn/blog/?p=640715</guid>
		<description><![CDATA[从Hello Android 书中截来的图。比较完整的Activity生命周期.]]></description>
		<wfw:commentRss>http://www.learnenjoy.cn/blog/?feed=rss2&amp;p=640715</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AsyncTask in Android</title>
		<link>http://www.learnenjoy.cn/blog/?p=640713</link>
		<comments>http://www.learnenjoy.cn/blog/?p=640713#comments</comments>
		<pubDate>Wed, 11 Aug 2010 16:11:50 +0000</pubDate>
		<dc:creator>Captain</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[AsyncTask]]></category>
		<category><![CDATA[异步]]></category>
		<category><![CDATA[线程]]></category>

		<guid isPermaLink="false">http://www.learnenjoy.cn/blog/?p=640713</guid>
		<description><![CDATA[在Android中使用AsyncTask android中有两种实现异步的途径，AsyncTask和线程。本篇日志记录AsyncTask的使用。 实现AsyncTask基本结构如下： 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 private class YourTask extends AsyncTask&#60;Object, String, [...]]]></description>
		<wfw:commentRss>http://www.learnenjoy.cn/blog/?feed=rss2&amp;p=640713</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing Network Services in Android</title>
		<link>http://www.learnenjoy.cn/blog/?p=640711</link>
		<comments>http://www.learnenjoy.cn/blog/?p=640711#comments</comments>
		<pubDate>Wed, 11 Aug 2010 13:40:22 +0000</pubDate>
		<dc:creator>Captain</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[permission]]></category>

		<guid isPermaLink="false">http://www.learnenjoy.cn/blog/?p=640711</guid>
		<description><![CDATA[在Android中访问网络 添加程序访问网络的权限 为了能够使程序访问网络资源，通常来说要设置以下权限： android.permission.INTERNET android.permission.ACCESS_NETWORK_STATE 检测/改变网络状态 在android中想要获得设备的网络状态，你必须要设置以下权限： android.permission.ACCESS_NETWORK_STATE 改变网络状态，你必须要设置以下权限： android.permission.CHANGE_NETWORK_STATE 我们可以通过 ConnectivityManager 来获取网络状态的相关信息，ConnectivityManager的getNetworkInfo方法返回一个NetworkInfo对象，有了这个对象我们就可以得到网络的相关信息，代码如下： // 获取ConnectivityManager ConnectivityManager connectMgr = &#40;ConnectivityManager&#41;getSystemService&#40;Context.CONNECTIVITY_SERVICE&#41;; // 获取NetworkInfo NetworkInfo netInfo = conMgr.getNetworkInfo&#40;ConnectivityManager.TYPE_MOBILE&#41;; // 网络是否可用 boolean isMobileAvail = netInfo.isAvailable&#40;&#41;; // 网络是否已经处于链接状态 boolean isMobileConn = netInfo.isConnected&#40;&#41;; // 是否处于漫游状态 boolean isRoamingConn = netInfo.isRoaming&#40;&#41;; 访问网络 一般移动设备与网络交互使用的数据是使用xml，下面举例如何获取网络中的xml数据，使用XmlPullParser和XmlResourcesParser的使用方法基本上是一样的，初始化步骤如下： URL xmlUrl = new URL&#40;xmlSource&#41;; XmlPullParser parser= XmlPullParserFactory.newInstance&#40;&#41;.newPullParser&#40;&#41;; parser.setInput&#40;xmlUrl.openStream&#40;&#41;, null&#41;;]]></description>
		<wfw:commentRss>http://www.learnenjoy.cn/blog/?feed=rss2&amp;p=640711</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detection of iPad &amp; iPhone &amp; iPod</title>
		<link>http://www.learnenjoy.cn/blog/?p=640706</link>
		<comments>http://www.learnenjoy.cn/blog/?p=640706#comments</comments>
		<pubDate>Mon, 09 Aug 2010 08:37:50 +0000</pubDate>
		<dc:creator>Captain</dc:creator>
				<category><![CDATA[JavascriPt]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[fontend]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[detection]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[orientation]]></category>
		<category><![CDATA[verticle]]></category>
		<category><![CDATA[截取]]></category>
		<category><![CDATA[检测]]></category>
		<category><![CDATA[横屏]]></category>
		<category><![CDATA[竖屏]]></category>

		<guid isPermaLink="false">http://www.learnenjoy.cn/blog/?p=640706</guid>
		<description><![CDATA[下一个项目是做Ipad的web应用，在网上做了一些功课，记录一些开发中可能会用到东西。 使用javascript判断设备类型 // platform的可能值为 iPad, iPod, iPhone alert(navigator.platform); 对应横屏竖屏引用不同的css文件 &#60;link rel=&#34;stylesheet&#34; media=&#34;all and (orientation:portrait)&#34; href=&#34;portrait.css&#34;&#62;&#60;!-- 竖屏 --&#62; &#60;link rel=&#34;stylesheet&#34; media=&#34;all and (orientation:landscape)&#34; href=&#34;landscape.css&#34;&#62;&#60;!-- 橫屏 --&#62; 用javascript判定当前是否横屏 alert(window.orientation) * window.orientation 为 0 表示竖屏 * window.orientation 为 90 表示向左横屏（相对于设备下方的操作按钮） * window.orientation is -90 表示向右横屏（相对于设备下方的操作按钮） * window.orientation is 180 表示向反竖屏（相对于设备下方的操作按钮） 通过JS动态判断横竖屏 当用户进行横竖屏转换的时候，可以通过onorientationchange事件监听 通过CSS截取字符串，并用...结尾 .title &#123; width:200px; white-space:nowrap; word-break:keep-all; [...]]]></description>
		<wfw:commentRss>http://www.learnenjoy.cn/blog/?feed=rss2&amp;p=640706</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using TabHost in Android</title>
		<link>http://www.learnenjoy.cn/blog/?p=640702</link>
		<comments>http://www.learnenjoy.cn/blog/?p=640702#comments</comments>
		<pubDate>Tue, 03 Aug 2010 02:06:15 +0000</pubDate>
		<dc:creator>Captain</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[framelayout]]></category>
		<category><![CDATA[tabhost]]></category>
		<category><![CDATA[tabwidget]]></category>

		<guid isPermaLink="false">http://www.learnenjoy.cn/blog/?p=640702</guid>
		<description><![CDATA[XML布局 基本布局如下图： 如图所示： 1. 实现tab的效果必须使用TabHost控件作为tab的根节点（并不是整个布局的根节点）。 2. TabHost下必须有一个id为andorid:id/tabs的TabWidget控件（用于显示各tab标签）。 3. TabHost下不需还有一个id为android:id/contents的FrameLayout控件（用于装载各标签的内容） 4. FrameLayout控件下必须有对应tab数量的layout控件(LinearLayout、RelativeLayout等，如图中的LinearLayout01和LinearLayout) Activity 对应activity中onCreate的代码如下 TabHost host = &#40;TabHost&#41; findViewById&#40;R.id.TabHost01&#41;; host.setup&#40;&#41;; //这句很重要，之前遗漏了这句，我异常了很久=.= &#160; TabSpec one = host.newTabSpec&#40;&#34;one&#34;&#41;; // 创建一个tab, 这里参数中的one是一个tag，标识作用 one.setIndicator&#40;&#34;顯示1&#34;&#41;; // 设置tab的变迁文字 one.setContent&#40;R.id.LinearLayout01&#41;; // 设定标签对应的内容layout &#160; TabSpec two = host.newTabSpec&#40;&#34;two&#34;&#41;; two.setIndicator&#40;&#34;顯示2&#34;&#41;; two.setContent&#40;R.id.LinearLayout02&#41;; &#160; host.addTab&#40;one&#41;; // 将one 标签加入host host.addTab&#40;two&#41;; host.setCurrentTabByTag&#40;&#34;two&#34;&#41;; // 设定当前选中的标签，参数就是新建tab是的tag 注意事项 如果只定义了布局（xml）文件，activity中没有对应的代码，运行程序时会报异常的，必须有以上这些基本的tabhost处理代码方能运行 其它补充 这里只是实现tab效果的其中一个方法而已，如果你的activity整个就是一个tab布局，你可以让你的activity继承TabActivity，具体实现在这篇中不进行说明]]></description>
		<wfw:commentRss>http://www.learnenjoy.cn/blog/?feed=rss2&amp;p=640702</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Animation in your application</title>
		<link>http://www.learnenjoy.cn/blog/?p=640693</link>
		<comments>http://www.learnenjoy.cn/blog/?p=640693#comments</comments>
		<pubDate>Sat, 31 Jul 2010 13:17:20 +0000</pubDate>
		<dc:creator>Captain</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[动画]]></category>

		<guid isPermaLink="false">http://www.learnenjoy.cn/blog/?p=640693</guid>
		<description><![CDATA[PS:这个主题的日志标题居然不支持中文，懒得花时间去该，就用英文标题了 android大概有四种实现动画的方式： 1. GIF图片实现 2. Frame-by-frame （好像是通过AnimationDrawable类来实现，目前还没研究） 3. OpenGL ES (说到动画怎么能不提到OpenGL呢) 4. Tweened animation （通过xml文件配置动画效果，绑定到指定控件上，这篇日志所记录的方式） 添加动画资源 在res-&#62;anim目录下建立 anim.xml ﻿ 这段xml代码定义了一个动画效果，alpha值从0到1，时间花费1000毫秒（即1秒） 将动画绑定到指定控件上 Animation fadeIn = AnimationUtils.loadAnimaition&#40;R.anim.anim&#41;; // 比如有个TextView的控件，id为 title TextView title = &#40;TextView&#41;findViewById&#40;R.id.title&#41;; // 指定控件的动画效果 title.setAnimation&#40;fadeIn&#41;; 这样就简单得实现动画效果与控件的绑定。 取消动画效果与控件的绑定 title.clearAnimation&#40;&#41;; 指定动画效果的事件监听 动画的生命周期有三个： start, end, repeat 示例代码如下： title.setAnimaitionListener&#40;new AnimationListener&#40;&#41;&#123; public void onAnimationEnd&#40;Animation animation&#41; &#123; Intent intent = new [...]]]></description>
		<wfw:commentRss>http://www.learnenjoy.cn/blog/?feed=rss2&amp;p=640693</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>创建android应用程序的偏好设定</title>
		<link>http://www.learnenjoy.cn/blog/?p=640689</link>
		<comments>http://www.learnenjoy.cn/blog/?p=640689#comments</comments>
		<pubDate>Sat, 31 Jul 2010 05:42:15 +0000</pubDate>
		<dc:creator>Captain</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[SharedPreferences]]></category>

		<guid isPermaLink="false">http://www.learnenjoy.cn/blog/?p=640689</guid>
		<description><![CDATA[创建应用程序设定 一款应用程序通常都需要存储一些基本的状态信息和用户数据，我们可以使用Android的Shared Preferences来实现这个功能。 在一个应用程序的所有activity中，我们都可以通过一个名称来访问Shared Preferences。因为这些设定信息是整个程序公用的，所以我们可以创建一个activity的子类（在这里举例为AppActivity），让程序中所有其他的activity继承AppActivity，我们在AppActivity中声明一个成员变量，用于标记Shared Preferencess的名称，这样一来在所有的activity中我们都可以统一地访问我们的Shared Preferencess。 // 在AppActivity中声明一个成员变量 public static final String APP_PREFERENCES = “APP_PREF”; 创建Shared preferences是没有数量限制的，所以你可以使用不同命名对应不同的类别，例如你可以分为应用设定(APP_PREFERENCES)和用户设定(USER_PREFERENCES)，怎么组织Shared Preferences取决于你自己。 添加Shared Preferences到应用程序中，需要以下几个步骤： 1. 使用getSharedPreferences()方法获取一个SharedPreferences的实例 2. 创建一个SharedPreferences.Editor对象 3. 使用editor对象修改设定 4. 使用editor的commit()方法提交修改 存储特定的设定 Shared Preferences中的每个设定都是以键值对的形式存储的，值可以是以下这些类型： . Boolean . Float . Integer . Long . String 当你决定好了要存储那些设定信息之后，你需要取得一个SharedPreferences实例并且使用Editior对象更新设定并提交修改。下面的例子中，存储了两个设定（用户名和年龄）： SharedPreferences settings = getSharedPreferences&#40;APP_PREFERENCES , MODE_PRIVATE&#41;; SharedPreferences.Editor prefEditor = settings.edit&#40;&#41;; prefEditor.putString&#40;“UserName”, “JaneDoe”&#41;; [...]]]></description>
		<wfw:commentRss>http://www.learnenjoy.cn/blog/?feed=rss2&amp;p=640689</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
