<?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>Jiramot.info &#187; android</title>
	<atom:link href="http://www.jiramot.info/tag/android/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jiramot.info</link>
	<description>Developer&#039;s Life</description>
	<lastBuildDate>Mon, 06 Feb 2012 08:49:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Gartner และ IDC บอกว่า Window Phone จะขึ้นเป็นอันดับ 2 ในปี 2015 ในตลาด Smart Phone!!</title>
		<link>http://www.jiramot.info/gartner-%e0%b9%81%e0%b8%a5%e0%b8%b0-idc-%e0%b8%9a%e0%b8%ad%e0%b8%81%e0%b8%a7%e0%b9%88%e0%b8%b2-window-phone-%e0%b8%88%e0%b8%b0%e0%b8%82%e0%b8%b6%e0%b9%89%e0%b8%99%e0%b9%80%e0%b8%9b%e0%b9%87%e0%b8%99</link>
		<comments>http://www.jiramot.info/gartner-%e0%b9%81%e0%b8%a5%e0%b8%b0-idc-%e0%b8%9a%e0%b8%ad%e0%b8%81%e0%b8%a7%e0%b9%88%e0%b8%b2-window-phone-%e0%b8%88%e0%b8%b0%e0%b8%82%e0%b8%b6%e0%b9%89%e0%b8%99%e0%b9%80%e0%b8%9b%e0%b9%87%e0%b8%99#comments</comments>
		<pubDate>Sun, 04 Sep 2011 20:16:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[window phone]]></category>

		<guid isPermaLink="false">http://www.jiramot.info/?p=1070</guid>
		<description><![CDATA[<p></p> <p>โดยส่วนแบ่งการตลาดของ Android จะปาเข้าไป 49%, Window Phone จะได้ 19.5% และ iPhone จะได้เพียง 17% แต่&#8230; แต่ปีนี้มันยังแค่ปี 2011 อยู่เลยนี่นา อีก เกือบ 4 ปีเลยน่ะนั้นหน่ะ ถึงวันนั้น อาจจะมี xOS, yOS ออกมาแล้วก็ได้</p> <p>หรือไม่ก็ Android อาจจะตายไปเพราะว่าไม่มีใครกล้าผลิต เพราะติดลิขสิทธิ์ไปซะหมด ก็ต้องรอดูต่อไป แต่ ณ วันนี้ ไม่ว่าใครจะยอดขายเท่าไหร่ แต่ทุกคนก็ต่างเผ้ารอการเปิดตัว iPhone 5 มากกว่า Smart Phone ตัวอื่นๆ </p> <p>ที่มา [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jiramot.info/wp-content/uploads/2011/09/window_phone.png" ><img src="http://www.jiramot.info/wp-content/uploads/2011/09/window_phone.png" alt="" title="window phone" width="520" height="329" class="aligncenter size-full wp-image-1071" /></a></p>
<p>โดยส่วนแบ่งการตลาดของ Android จะปาเข้าไป 49%, Window Phone จะได้ 19.5% และ iPhone จะได้เพียง 17%<br />
แต่&#8230;<br />
<span id="more-1070"></span><br />
แต่ปีนี้มันยังแค่ปี 2011 อยู่เลยนี่นา อีก เกือบ 4 ปีเลยน่ะนั้นหน่ะ ถึงวันนั้น อาจจะมี xOS, yOS ออกมาแล้วก็ได้</p>
<p>หรือไม่ก็ Android อาจจะตายไปเพราะว่าไม่มีใครกล้าผลิต เพราะติดลิขสิทธิ์ไปซะหมด ก็ต้องรอดูต่อไป แต่ ณ วันนี้ ไม่ว่าใครจะยอดขายเท่าไหร่ แต่ทุกคนก็ต่างเผ้ารอการเปิดตัว iPhone 5 มากกว่า Smart Phone ตัวอื่นๆ <img src='http://www.jiramot.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>ที่มา <a target="_blank" rel="nofollow" href="http://www.jiramot.info/goto/http://www.bgr.com/2011/09/02/microsoft-windows-phone-will-be-no-2-smartphone-os-by-2015/" >BGR</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiramot.info/gartner-%e0%b9%81%e0%b8%a5%e0%b8%b0-idc-%e0%b8%9a%e0%b8%ad%e0%b8%81%e0%b8%a7%e0%b9%88%e0%b8%b2-window-phone-%e0%b8%88%e0%b8%b0%e0%b8%82%e0%b8%b6%e0%b9%89%e0%b8%99%e0%b9%80%e0%b8%9b%e0%b9%87%e0%b8%99/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hide android keyboard</title>
		<link>http://www.jiramot.info/hide-android-keyboard</link>
		<comments>http://www.jiramot.info/hide-android-keyboard#comments</comments>
		<pubDate>Wed, 27 Jul 2011 11:23:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://www.jiramot.info/?p=1030</guid>
		<description><![CDATA[<p>insert this code into your activity</p> getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); <p>Or you can force Android to hide the virtual keyboard using the InputMethodManager, calling hideSoftInputFromWindow, passing in the token of the window containing your edit field.</p> InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0); ]]></description>
			<content:encoded><![CDATA[<p>insert this code into your activity</p>
<pre>
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
</pre>
<p>Or you can force Android to hide the virtual keyboard using the InputMethodManager, calling hideSoftInputFromWindow, passing in the token of the window containing your edit field.</p>
<pre>
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jiramot.info/hide-android-keyboard/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google+</title>
		<link>http://www.jiramot.info/google-plus</link>
		<comments>http://www.jiramot.info/google-plus#comments</comments>
		<pubDate>Tue, 19 Jul 2011 15:00:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://www.jiramot.info/?p=1017</guid>
		<description><![CDATA[<p>หลังจากที่ได้พ่ายแพ้สงครามจาก Google buzz วันนี้ Google ได้กลับไปตั้งหลักใหม่ ไม่ว่าจะเป็นการปูทางมาด้วย &#8220;ปุ่ม+1&#8243; (Goole Plus 1) ให้เว็บต่างๆได้เอาไปใช้งานกันแล้ว ยังมีผู้ใช้ Android จำนวนมากที่รอใช้บริการใหม่ๆ ของ Google อยู่ตลอดเวลา และการหลอมรวมบริการ cloud อื่นๆ ที่มีพร้อมอยู่แล้ว เช่น google map, android, google search, google talk ฯลฯ จึงได้ส่งบริการใหม่ล่าสุดใน</p> <p class="wp-caption-text">Google+</p> Google+ (อ่านว่า กูเกิลพลัส) คือบริการ social network ของกูเกิลที่เป็นข่าวกันมานาน แต่มันไม่ใช่ social network ในรูปแบบ Facebook/Twitter ซะทีเดียว มันเป็นบริการกึ่งๆ ระหว่าง &#8220;เว็บแยกเว็บใหม่&#8221; กับ &#8220;การแทรกตัวเข้าไปในบริการเดิมๆ ของกูเกิล&#8221; มากกว่า</p> <p>ก่อนจะเข้าเรื่องว่า Google+ [...]]]></description>
			<content:encoded><![CDATA[<p>หลังจากที่ได้พ่ายแพ้สงครามจาก Google buzz วันนี้ Google ได้กลับไปตั้งหลักใหม่ ไม่ว่าจะเป็นการปูทางมาด้วย &#8220;<strong>ปุ่ม+1&#8243;</strong> (Goole Plus 1) ให้เว็บต่างๆได้เอาไปใช้งานกันแล้ว ยังมีผู้ใช้ Android จำนวนมากที่รอใช้บริการใหม่ๆ ของ Google อยู่ตลอดเวลา และการหลอมรวมบริการ cloud อื่นๆ ที่มีพร้อมอยู่แล้ว เช่น google map, android, google search, google talk ฯลฯ จึงได้ส่งบริการใหม่ล่าสุดใน</p>
<div id="attachment_1019" class="wp-caption aligncenter" style="width: 524px"><a href="http://www.jiramot.info/wp-content/uploads/2011/07/Screen-shot-2011-07-19-at-9.49.38-PM.png" ><img class="size-full wp-image-1019" title="Google+" src="http://www.jiramot.info/wp-content/uploads/2011/07/Screen-shot-2011-07-19-at-9.49.38-PM.png" alt="Google+" width="514" height="458" /></a><p class="wp-caption-text">Google+</p></div>
<div><span style="font-family: tahoma, arial, helvetica, sans-serif;"><strong><span id="more-1017"></span>Google+ </strong>(อ่านว่า <strong>กูเกิลพลัส</strong>) คือบริการ social network ของกูเกิลที่เป็นข่าวกันมานาน แต่มันไม่ใช่ social network ในรูปแบบ Facebook/Twitter ซะทีเดียว มันเป็นบริการกึ่งๆ ระหว่าง &#8220;เว็บแยกเว็บใหม่&#8221; กับ &#8220;การแทรกตัวเข้าไปในบริการเดิมๆ ของกูเกิล&#8221; มากกว่า</p>
<p>ก่อนจะเข้าเรื่องว่า <strong>Google+ คืออะไร</strong> หน้าตาเป็นอย่างไร ต้องแจ้งก่อนว่าตอนนี้ <strong>Google+ </strong>ยังเปิดบริการแบบ invitation-only อยู่ ดังนั้นเรามีข้อมูลเฉพาะเท่าที่กูเกิลประกาศ และสื่อต่างประเทศที่ได้ลองใช้แล้วเท่านั้น</p>
<h3>
Google+ คืออะไร</h3>
<p><strong>Google+ คือ</strong></p>
<ul>
<li>เว็บใหม่ของกูเกิล plus.google.com สำหรับการแชร์ข้อมูลกับเพื่อนๆ</li>
<li>เข้าได้จากมือถือด้วย โดยมีแอพบน Android แล้ว (ต้องใช้ invite อยู่ดี) และจะมีรุ่น mobile web กับ iPhone ตามมา</li>
<li><span style="color: #333333; font-size: x-small;">แถบด้านบนสุดของเว็บกูเกิลทุกอัน (แถบนี้เรียก sandbar) จะเปลี่ยนเป็นสีดำให้เข้ากับธีม Google+ และจะมีลิงก์ +You (ภาษาไทยใช้ &#8220;+คุณ&#8221;) ขึ้นเป็นอันแรกสุด ให้เราคลิกเข้า Google+ ได้ง่ายๆ</span></li>
</ul>
<p><span style="color: #333333; font-size: x-small;"><strong>โดย Google+ มีฟังก์ชั่นดังนี้</strong></p>
<p><span style="font-family: tahoma, arial, helvetica, sans-serif;"><strong>Circle</strong> ที่เราสามารถเลือกเพื่อนของเรามาตั้งเป็นกลุ่มๆหนึ่งได้ ทำให้เราสามารถเลือกดูข่าวสาร ของ Circle หรือแชร์สถานะของเราให้เฉพาะกลุ่มที่เราต้องการได้( Facebook ยังทำได้แค่เลือกรายคน)</span></p>
<p><span style="font-family: tahoma, arial, helvetica, sans-serif;"><strong>Spark</strong> เป็นเหมือนหน้าค้นข่าวสารที่เราสนใจ (ต้องเริ่มด้วยการใส่สิ่งที่สนใจไปก่อน) โดยหากพบข้อมูลใหม่ๆ Spark ก็จะนำมาแสดงในหน้านี้เพื่อให้เราอ่านหรือแชร์ให้เพื่อนแสดงความคิดเห็นลงไปได้</span></p>
<p><span style="font-family: tahoma, arial, helvetica, sans-serif;"><strong>Hangout</strong> เปิดการเปิดห้องวีดีโอแชททิ้งไว้ และบอกว่าตอนนี้ว่างอยู่ใครก็ได้เข้ามาคุยหน่อย หน้าตาก็เป็นเหมือนการประชุมสายกับเพื่อนๆที่เข้ามาคุยนั้นเอง</span></p>
<p><span style="font-family: tahoma, arial, helvetica, sans-serif;"><strong>Instant Upload </strong>ทุกรูปที่เราถ่ายจะถูกอัพขึ้น Google+ โดยอัตโนมัติ ทำให้เราสามารถเข้ามาแชน์สถานะและเลือกรูปได้ทุกรูปที่เราเคยถ่ายไว้โดยไม่ต้องมาเสียเวลาอัพโหลด</span></p>
<p><span style="font-family: tahoma, arial, helvetica, sans-serif;"><strong>Huddle</strong> เป็นตัวที่มาตีที่ Facebook ยังไม่ได้ทำ คือการแชทเป็นกลุ่มโดยใช้กลุ่มโดยเลือกกลุ่มเพื่อนๆ จากใน Circle นั่นเอง (Facebook ต้องตั้งกลุ่ม และชวนเพื่อนๆเข้ากลุ่มก่อน</span></p>
<p>ถ้าอ่านแล้วไม่รู้เรื่องละก้อ ลองไป <a target="_blank" rel="nofollow" href="http://www.jiramot.info/goto/https://plus.google.com/109164796399973443954/posts" title="jiramot's google+"  target="_blank">google+ ของผมก็ได้ครับ</a> :p</p>
<p></span></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.jiramot.info/google-plus/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android vs iPhone4</title>
		<link>http://www.jiramot.info/android-vs-iphone4</link>
		<comments>http://www.jiramot.info/android-vs-iphone4#comments</comments>
		<pubDate>Tue, 19 Jul 2011 14:41:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://www.jiramot.info/?p=1011</guid>
		<description><![CDATA[<p>หลังจาก android เครื่องแรกได้ขายไปพร้อมกับข้อขับข้องใจหลายๆประการและเพราะอะไรผมจึงซื้อมัน จากวันนั้นจนวันนี้ก็เป็นเวลาเกือบ 2 ปีที่ผมไม่ได้จับ android อีกเลย</p> <p>หลังจากขาย HTC Magic ไปเมื่อ 2 ปีที่แล้ว ผมก็กลับมาใช้ Nokia E Series เครื่องเก่าตามเดิม แล้วก็ไปซื้อ Blackberry Bold 9700  ตามกระแส และแล้วสิ่งที่รอคอยก็มาถึง การมาของ iPhone 4 ที่ผมตั่งใจว่าจะกลับมาใช้ iPhone อีกครั้งก็ได้เปิดตัว เมื่อขายในไทยก็เลยไปซื้อเจ้า iPhone4 เพราะเพื่อว่าต้องการเขียนโปรแกรมบน iOS นั้นเอง</p> <p>จาก ณ ตอนแรก ผมใช้ iPhone 3G แล้วขายไปเพราะว่า 3GS กำลังจะวางขาย ก็เลยตั่งใจว่าจะขาย แล้วรอ และด้วยอาการอยากเล่น android ก็เลยไปซื้อ HTC Magic แล้วก็พบว่าประสบการณ์ใช้งานมันไม่น่าพึงพอใจ เพราะผมติดการใช้ [...]]]></description>
			<content:encoded><![CDATA[<p>หลังจาก android เครื่องแรกได้ขายไปพร้อมกับ<a href="http://www.jiramot.info/%E0%B9%80%E0%B8%AB%E0%B8%95%E0%B8%B8%E0%B8%9C%E0%B8%A5%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%9C%E0%B8%A1%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%8A%E0%B8%AD%E0%B8%9A-android-%E0%B9%81%E0%B8%A5%E0%B8%B0%E0%B8%AD" >ข้อขับข้องใจหลายๆประการและเพราะอะไรผมจึงซื้อมัน</a> จากวันนั้นจนวันนี้ก็เป็นเวลาเกือบ 2 ปีที่ผมไม่ได้จับ android อีกเลย</p>
<p>หลังจากขาย HTC Magic ไปเมื่อ 2 ปีที่แล้ว ผมก็กลับมาใช้ Nokia E Series เครื่องเก่าตามเดิม แล้วก็ไปซื้อ Blackberry Bold 9700  ตามกระแส และแล้วสิ่งที่รอคอยก็มาถึง การมาของ iPhone 4 ที่ผมตั่งใจว่าจะกลับมาใช้ iPhone อีกครั้งก็ได้เปิดตัว เมื่อขายในไทยก็เลยไปซื้อเจ้า iPhone4 เพราะเพื่อว่าต้องการเขียนโปรแกรมบน iOS นั้นเอง</p>
<p>จาก ณ ตอนแรก ผมใช้ iPhone 3G แล้วขายไปเพราะว่า 3GS กำลังจะวางขาย ก็เลยตั่งใจว่าจะขาย แล้วรอ และด้วยอาการอยากเล่น android ก็เลยไปซื้อ HTC Magic แล้วก็พบว่าประสบการณ์ใช้งานมันไม่น่าพึงพอใจ เพราะผมติดการใช้ iPhone มากกว่านั้นเอง</p>
<p>พอใช้ iPhone4 จนชิน ก็เลยกะว่าสมัครงานเขียนโปรแกรมบน iOS แม่งซะเลยดีกว่า อยากลองหัด แต่ก็ด้วยความจำเป็นบางอย่างทำให้ชีวิตต้องระหกระเหินมาเขียน Android อีกครั้ง ก็เลยทำให้ตัดสินใจซื้อเจ้า Android อีกครั้ง แต่ครั้งนี้มันคือ Google Phone ที่ชื่อว่า Nexus S</p>
<p><span id="more-1011"></span></p>
<p>ทำไมต้อง Nexus S เพราะว่ามันเป็นเครื่องทดสอบของ Google ซึ่งมาพร้อม NFC ผมอยากจะลองเทสอะไรหลายๆอย่าง และด้วยราคาที่ทิ้งดิ่ง เหลือ 11900 บาทก็เลยทำการขายใบจอง Samsung Galaxy S2 ไปเพื่อซื้อเจ้า Nexus S แทน</p>
<p>ประสบการณครั้งใหม่ เมื่อใช้ Android Nexus S และ iPhone4</p>
<p>-ปัญหาเดิมๆ ก็ยังคงเป็นเหมือนเดิม การจูน Touch Screen หรืออัลกอลิทึมในการจับจุดของ Android ยังไม่เปลี่ยนแปลง จากวันนั้น HTC Magic ไม่รองรับ Multi Touch จนวันนี้ Android แต่ละตัวรองรับ Multi Touch ได้เป็น 10 จุด แต่อัลกอรึทึมในการจับนิ้วจิงๆ กลับยังไม่แก้ไข ลองจับมือถือด้วยมือข้างเดียว แล้วพยายามกดข้อมูลในลิส อะไรก็ได้ ตัวอย่างเช่น Contact List หากตรงอุ้งมือเราไปแตะจอ แล้วเราไป Touch ที่ลิสด้วยนิ้วอื่น จะทำให้เครื่องจับจุดที่เรากดผิดทันที ปัญหานี้ยังคงเป็นสืบเนื่องมาถึงปัจจุบัน ตั่งแต่ android ยุคแรกๆ จนวันนี้ แต่ iOS ไม่เป็น</p>
<p>ลองจิ้มลงในหน้าจอสักอย่างค้างไว้ แล้วไม่เคลื่อนไหว แล้วใช้อีกนิ้วในการเลือกเมนู หรือใช้งานปกติ  android จะไม่รู้ว่าจุดไหนที่เราใช้งานจริงๆ แต่ iOS รู้</p>
<p>แล้วมันเกิดจากอะไรหละ?</p>
<p>มันเกิดจากที่คนเขียนโปรแกรมไม่ทำการ Filter จุดที่คิดว่าไม่ใช้เกิดจากการใช้งานออก ทำให้โปรแกรมมองเป็นการจดที่ผิดจุดนั่นเอง</p>
<p>-เมนูโคดลึกกว่าจะใช้ได้ ยิ่งกว่าจะลบโปรแกรมสักตัวนึงก็ เข้าไป Setting&gt; Application&gt; &#8230;. กว่าจะลบได้ แล้ว iPhone และ กดค้างไว้ที่หน้าจอเลย แล้วก็ลบ แสนจะง่าย</p>
<p>เอาเป็นไว่า ไม่ว่าจะเปลี่ยนแปลงอะไรไปเยอะแยะมากมายใน Android แต่ก็ยังคงให้ประสบการณ์การใช้งานเหมือนเดิมไม่เปลี่ยนแปลง</p>
<p>ผมยังคง Recommend iPhone ต่อไปสำหรับคนที่งบถึง และต้องการ Smart Phone ที่ไม่ใช้ Geek</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiramot.info/android-vs-iphone4/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Android Image in ListView lag</title>
		<link>http://www.jiramot.info/android-image-in-listview-lag</link>
		<comments>http://www.jiramot.info/android-image-in-listview-lag#comments</comments>
		<pubDate>Wed, 06 Jul 2011 14:54:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://www.jiramot.info/?p=995</guid>
		<description><![CDATA[ String url = ... imageView.setTag&#40;url&#41;; imageLoader.Download&#40;url, activity, imageView&#41;; <p> This class for Load the image</p> &#160; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; import java.net.URL; import java.util.HashMap; import java.util.Stack; &#160; import android.app.Activity; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.util.Log; import android.widget.ImageView; &#160; import com.skuup.R; &#160; public class [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">String</span> url <span style="color: #339933;">=</span> ...
<span style="color: #006633;">imageView</span>.<span style="color: #006633;">setTag</span><span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
imageLoader.<span style="color: #006633;">Download</span><span style="color: #009900;">&#40;</span>url, activity, imageView<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><span id="more-995"></span><br />
This class for Load the image</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.File</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.FileInputStream</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.FileNotFoundException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.FileOutputStream</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.InputStream</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.OutputStream</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.URL</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.HashMap</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Stack</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.app.Activity</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.content.Context</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.graphics.Bitmap</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.graphics.BitmapFactory</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.util.Log</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.ImageView</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.skuup.R</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ImageLoader <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> TAG <span style="color: #339933;">=</span> ImageLoader.<span style="color: #000000; font-weight: bold;">class</span>.<span style="color: #006633;">getSimpleName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> PREFIX_IMG <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;img_&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// the simplest in-memory cache implementation. This should be replaced with</span>
	<span style="color: #666666; font-style: italic;">// something like SoftReference or BitmapOptions.inPurgeable(since 1.6)</span>
	<span style="color: #000000; font-weight: bold;">private</span> HashMap<span style="color: #339933;">&lt;</span>String, Bitmap<span style="color: #339933;">&gt;</span> cache <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HashMap<span style="color: #339933;">&lt;</span>String, Bitmap<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">File</span> cacheDir<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> ImageLoader<span style="color: #009900;">&#40;</span><span style="color: #003399;">Context</span> context<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// Make the background thead low priority. This way it will not affect the</span>
		<span style="color: #666666; font-style: italic;">// UI performance</span>
		photoLoaderThread.<span style="color: #006633;">setPriority</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Thread</span>.<span style="color: #006633;">NORM_PRIORITY</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Find the dir to save cached images</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>android.<span style="color: #006633;">os</span>.<span style="color: #003399;">Environment</span>.<span style="color: #006633;">getExternalStorageState</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>
				android.<span style="color: #006633;">os</span>.<span style="color: #003399;">Environment</span>.<span style="color: #006633;">MEDIA_MOUNTED</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			cacheDir <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>android.<span style="color: #006633;">os</span>.<span style="color: #003399;">Environment</span>.<span style="color: #006633;">getExternalStorageDirectory</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>,
					context.<span style="color: #006633;">getResources</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">string</span>.<span style="color: #006633;">temp_image_folder</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">else</span>
			cacheDir <span style="color: #339933;">=</span> context.<span style="color: #006633;">getCacheDir</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>cacheDir.<span style="color: #006633;">exists</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			cacheDir.<span style="color: #006633;">mkdirs</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> stub_id <span style="color: #339933;">=</span> R.<span style="color: #006633;">drawable</span>.<span style="color: #006633;">icon</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> DisplayImage<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> url, Activity activity, ImageView imageView<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>cache.<span style="color: #006633;">containsKey</span><span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			imageView.<span style="color: #006633;">setImageBitmap</span><span style="color: #009900;">&#40;</span>cache.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
			queuePhoto<span style="color: #009900;">&#40;</span>url, activity, imageView<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			imageView.<span style="color: #006633;">setImageResource</span><span style="color: #009900;">&#40;</span>stub_id<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> queuePhoto<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> url, Activity activity, ImageView imageView<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// This ImageView may be used for other images before. So there may be some</span>
		<span style="color: #666666; font-style: italic;">// old tasks in the queue. We need to discard them.</span>
		photosQueue.<span style="color: #006633;">Clean</span><span style="color: #009900;">&#40;</span>imageView<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		PhotoToLoad p <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PhotoToLoad<span style="color: #009900;">&#40;</span>url, imageView<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">synchronized</span> <span style="color: #009900;">&#40;</span>photosQueue.<span style="color: #006633;">photosToLoad</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			photosQueue.<span style="color: #006633;">photosToLoad</span>.<span style="color: #006633;">push</span><span style="color: #009900;">&#40;</span>p<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			photosQueue.<span style="color: #006633;">photosToLoad</span>.<span style="color: #006633;">notifyAll</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// start thread if it's not started yet</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>photoLoaderThread.<span style="color: #006633;">getState</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #003399;">Thread</span>.<span style="color: #006633;">State</span>.<span style="color: #000000; font-weight: bold;">NEW</span><span style="color: #009900;">&#41;</span>
			photoLoaderThread.<span style="color: #006633;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> Bitmap getBitmap<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> url<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// I identify images by hashcode. Not a perfect solution, good for the demo.</span>
		<span style="color: #003399;">String</span> filename <span style="color: #339933;">=</span> <span style="color: #003399;">String</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span>PREFIX_IMG <span style="color: #339933;">+</span> Utils.<span style="color: #006633;">md5</span><span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;.jpg&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">// String filename=String.valueOf(url.hashCode());</span>
		<span style="color: #003399;">File</span> f <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>cacheDir, filename<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// from SD cache</span>
		Bitmap b <span style="color: #339933;">=</span> decodeFile<span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>b <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> b<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// from web</span>
		<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
			Bitmap bitmap <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
			<span style="color: #003399;">InputStream</span> is <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">URL</span><span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">openStream</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #003399;">OutputStream</span> os <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FileOutputStream</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			Utils.<span style="color: #006633;">CopyStream</span><span style="color: #009900;">&#40;</span>is, os<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			os.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			bitmap <span style="color: #339933;">=</span> decodeFile<span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">return</span> bitmap<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> ex<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			Log.<span style="color: #006633;">e</span><span style="color: #009900;">&#40;</span>TAG, <span style="color: #0000ff;">&quot;ERROR&quot;</span>, ex<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// decodes image and scales it to reduce memory consumption</span>
	<span style="color: #000000; font-weight: bold;">private</span> Bitmap decodeFile<span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> f<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		Bitmap result <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// decode image size</span>
			BitmapFactory.<span style="color: #006633;">Options</span> o <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> BitmapFactory.<span style="color: #006633;">Options</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			o.<span style="color: #006633;">inJustDecodeBounds</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
			BitmapFactory.<span style="color: #006633;">decodeStream</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FileInputStream</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span>, <span style="color: #000066; font-weight: bold;">null</span>, o<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">// Find the correct scale value. It should be the power of 2.</span>
			<span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> REQUIRED_SIZE <span style="color: #339933;">=</span> <span style="color: #cc66cc;">150</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">int</span> width_tmp <span style="color: #339933;">=</span> o.<span style="color: #006633;">outWidth</span>, height_tmp <span style="color: #339933;">=</span> o.<span style="color: #006633;">outHeight</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">int</span> scale <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>width_tmp <span style="color: #339933;">/</span> <span style="color: #cc66cc;">2</span> <span style="color: #339933;">&lt;</span> REQUIRED_SIZE <span style="color: #339933;">||</span> height_tmp <span style="color: #339933;">/</span> <span style="color: #cc66cc;">2</span> <span style="color: #339933;">&lt;</span> REQUIRED_SIZE<span style="color: #009900;">&#41;</span>
					<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
				width_tmp <span style="color: #339933;">/=</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
				height_tmp <span style="color: #339933;">/=</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
				scale<span style="color: #339933;">++;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">// decode with inSampleSize</span>
			BitmapFactory.<span style="color: #006633;">Options</span> o2 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> BitmapFactory.<span style="color: #006633;">Options</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			o2.<span style="color: #006633;">inSampleSize</span> <span style="color: #339933;">=</span> scale<span style="color: #339933;">;</span>
			result <span style="color: #339933;">=</span> BitmapFactory.<span style="color: #006633;">decodeStream</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FileInputStream</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span>, <span style="color: #000066; font-weight: bold;">null</span>, o2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">return</span> result<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">FileNotFoundException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			Log.<span style="color: #006633;">e</span><span style="color: #009900;">&#40;</span>TAG, <span style="color: #0000ff;">&quot;ERROR&quot;</span>, e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> result<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Task for the queue</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">class</span> PhotoToLoad <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> url<span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">public</span> ImageView imageView<span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">public</span> PhotoToLoad<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> u, ImageView i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			url <span style="color: #339933;">=</span> u<span style="color: #339933;">;</span>
			imageView <span style="color: #339933;">=</span> i<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	PhotosQueue photosQueue <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PhotosQueue<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> stopThread<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		photoLoaderThread.<span style="color: #006633;">interrupt</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// stores list of photos to download</span>
	<span style="color: #000000; font-weight: bold;">class</span> PhotosQueue <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">private</span> Stack<span style="color: #339933;">&lt;</span>PhotoToLoad<span style="color: #339933;">&gt;</span> photosToLoad <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Stack<span style="color: #339933;">&lt;</span>PhotoToLoad<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// removes all instances of this ImageView</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> Clean<span style="color: #009900;">&#40;</span>ImageView image<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> j <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> j <span style="color: #339933;">&lt;</span> photosToLoad.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>photosToLoad.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>j<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">imageView</span> <span style="color: #339933;">==</span> image<span style="color: #009900;">&#41;</span>
					photosToLoad.<span style="color: #006633;">remove</span><span style="color: #009900;">&#40;</span>j<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000000; font-weight: bold;">else</span>
					<span style="color: #339933;">++</span>j<span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">class</span> PhotosLoader <span style="color: #000000; font-weight: bold;">extends</span> <span style="color: #003399;">Thread</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #666666; font-style: italic;">// thread waits until there are any images to load in the queue</span>
					<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>photosQueue.<span style="color: #006633;">photosToLoad</span>.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
						<span style="color: #000000; font-weight: bold;">synchronized</span> <span style="color: #009900;">&#40;</span>photosQueue.<span style="color: #006633;">photosToLoad</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
							photosQueue.<span style="color: #006633;">photosToLoad</span>.<span style="color: #006633;">wait</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						<span style="color: #009900;">&#125;</span>
					<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>photosQueue.<span style="color: #006633;">photosToLoad</span>.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						PhotoToLoad photoToLoad<span style="color: #339933;">;</span>
						<span style="color: #000000; font-weight: bold;">synchronized</span> <span style="color: #009900;">&#40;</span>photosQueue.<span style="color: #006633;">photosToLoad</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
							photoToLoad <span style="color: #339933;">=</span> photosQueue.<span style="color: #006633;">photosToLoad</span>.<span style="color: #006633;">pop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						<span style="color: #009900;">&#125;</span>
						Bitmap bmp <span style="color: #339933;">=</span> getBitmap<span style="color: #009900;">&#40;</span>photoToLoad.<span style="color: #006633;">url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						cache.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span>photoToLoad.<span style="color: #006633;">url</span>, bmp<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#41;</span> photoToLoad.<span style="color: #006633;">imageView</span>.<span style="color: #006633;">getTag</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
								.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>photoToLoad.<span style="color: #006633;">url</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
							BitmapDisplayer bd <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> BitmapDisplayer<span style="color: #009900;">&#40;</span>bmp,
									photoToLoad.<span style="color: #006633;">imageView</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
							Activity a <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>Activity<span style="color: #009900;">&#41;</span> photoToLoad.<span style="color: #006633;">imageView</span>.<span style="color: #006633;">getContext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
							a.<span style="color: #006633;">runOnUiThread</span><span style="color: #009900;">&#40;</span>bd<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						<span style="color: #009900;">&#125;</span>
					<span style="color: #009900;">&#125;</span>
					<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Thread</span>.<span style="color: #006633;">interrupted</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
						<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">InterruptedException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #666666; font-style: italic;">// allow thread to exit</span>
				Log.<span style="color: #006633;">e</span><span style="color: #009900;">&#40;</span>TAG, <span style="color: #0000ff;">&quot;ERROR&quot;</span>, e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	PhotosLoader photoLoaderThread <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PhotosLoader<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Used to display bitmap in the UI thread</span>
	<span style="color: #000000; font-weight: bold;">class</span> BitmapDisplayer <span style="color: #000000; font-weight: bold;">implements</span> <span style="color: #003399;">Runnable</span> <span style="color: #009900;">&#123;</span>
		Bitmap bitmap<span style="color: #339933;">;</span>
		ImageView imageView<span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">public</span> BitmapDisplayer<span style="color: #009900;">&#40;</span>Bitmap b, ImageView i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			bitmap <span style="color: #339933;">=</span> b<span style="color: #339933;">;</span>
			imageView <span style="color: #339933;">=</span> i<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>bitmap <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
				imageView.<span style="color: #006633;">setImageBitmap</span><span style="color: #009900;">&#40;</span>bitmap<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">else</span>
				imageView.<span style="color: #006633;">setImageResource</span><span style="color: #009900;">&#40;</span>stub_id<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> clearCache<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// clear memory cache</span>
		cache.<span style="color: #006633;">clear</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// clear SD cache</span>
		<span style="color: #003399;">File</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> files <span style="color: #339933;">=</span> cacheDir.<span style="color: #006633;">listFiles</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> f <span style="color: #339933;">:</span> files<span style="color: #009900;">&#41;</span>
			f.<span style="color: #006633;">delete</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.jiramot.info/android-image-in-listview-lag/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android ListView in ScrollView Problem</title>
		<link>http://www.jiramot.info/android-listview-in-scrollview-problem</link>
		<comments>http://www.jiramot.info/android-listview-in-scrollview-problem#comments</comments>
		<pubDate>Wed, 06 Jul 2011 14:27:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://www.jiramot.info/?p=993</guid>
		<description><![CDATA[<p>This is the method to re-calculate listview height to fix the problem.</p> public static void setListViewHeightBasedOnChildren&#40;ListView listView&#41; &#123; ListAdapter listAdapter = listView.getAdapter&#40;&#41;; if &#40;listAdapter == null&#41; &#123; // pre-condition return; &#125; &#160; int totalHeight = 0; int desiredWidth = MeasureSpec.makeMeasureSpec&#40;listView.getWidth&#40;&#41;, MeasureSpec.AT_MOST&#41;; for &#40;int i = 0; i &#60; listAdapter.getCount&#40;&#41;; i++&#41; &#123; View listItem = [...]]]></description>
			<content:encoded><![CDATA[<p>This is the method to re-calculate listview height to fix the problem.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> setListViewHeightBasedOnChildren<span style="color: #009900;">&#40;</span><span style="color: #003399;">ListView</span> listView<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		ListAdapter listAdapter <span style="color: #339933;">=</span> listView.<span style="color: #006633;">getAdapter</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>listAdapter <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// pre-condition</span>
			<span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">int</span> totalHeight <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> desiredWidth <span style="color: #339933;">=</span> MeasureSpec.<span style="color: #006633;">makeMeasureSpec</span><span style="color: #009900;">&#40;</span>listView.<span style="color: #006633;">getWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, MeasureSpec.<span style="color: #006633;">AT_MOST</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> listAdapter.<span style="color: #006633;">getCount</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #003399;">View</span> listItem <span style="color: #339933;">=</span> listAdapter.<span style="color: #006633;">getView</span><span style="color: #009900;">&#40;</span>i, <span style="color: #000066; font-weight: bold;">null</span>, listView<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			listItem.<span style="color: #006633;">measure</span><span style="color: #009900;">&#40;</span>desiredWidth, MeasureSpec.<span style="color: #006633;">UNSPECIFIED</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			totalHeight <span style="color: #339933;">+=</span> listItem.<span style="color: #006633;">getMeasuredHeight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		ViewGroup.<span style="color: #006633;">LayoutParams</span> params <span style="color: #339933;">=</span> listView.<span style="color: #006633;">getLayoutParams</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		params.<span style="color: #006633;">height</span> <span style="color: #339933;">=</span> totalHeight <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>listView.<span style="color: #006633;">getDividerHeight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span>listAdapter.<span style="color: #006633;">getCount</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		listView.<span style="color: #006633;">setLayoutParams</span><span style="color: #009900;">&#40;</span>params<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		listView.<span style="color: #006633;">requestLayout</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.jiramot.info/android-listview-in-scrollview-problem/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why placed a &#8220;dot&#8221; in front of the activity name</title>
		<link>http://www.jiramot.info/why-placed-a-dot-in-front-of-the-activity-name</link>
		<comments>http://www.jiramot.info/why-placed-a-dot-in-front-of-the-activity-name#comments</comments>
		<pubDate>Wed, 18 May 2011 07:03:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://www.jiramot.info/?p=961</guid>
		<description><![CDATA[ <p>So, if your app package is: com.my.package then:</p> <p>.YourActivity means that your class is inside com.my.package. YourActivity means that your class is inside com.my.package (same as above). .activities.YourActivity means that your class is inside com.my.package.activitites.</p> <p>You can even do something like: com.my.package.activities.YourActivity which is useful when you want to have different versions of [...]]]></description>
			<content:encoded><![CDATA[<pre>
<activity android:name=".NewActivity"></activity>
</pre>
<p>So, if your app package is: com.my.package then:</p>
<p><b>.YourActivity</b> means that your class is inside com.my.package.<br />
<b>YourActivity</b> means that your class is inside com.my.package (same as above).<br />
<b>.activities.YourActivity</b> means that your class is inside com.my.package.activitites.</p>
<p>You can even do something like: com.my.package.activities.YourActivity which is useful when you want to have different versions of your app and use Ant to change the references to the package automatically.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiramot.info/why-placed-a-dot-in-front-of-the-activity-name/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android requires compiler compliance level 5.0. Please fix project properties.</title>
		<link>http://www.jiramot.info/android-requires-compiler-compliance-level-5-0-please-fix-project-properties</link>
		<comments>http://www.jiramot.info/android-requires-compiler-compliance-level-5-0-please-fix-project-properties#comments</comments>
		<pubDate>Thu, 31 Mar 2011 09:34:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://www.jiramot.info/?p=947</guid>
		<description><![CDATA[<p> I believe that Android is talking about the Java bytecode format, which you can set in "Window/Preferences", "Java/Compiler/Compiler Compliance Level". </p> ]]></description>
			<content:encoded><![CDATA[<p><code><br />
I believe that Android is talking about the Java bytecode format, which you can set in "Window/Preferences", "Java/Compiler/Compiler Compliance Level".<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiramot.info/android-requires-compiler-compliance-level-5-0-please-fix-project-properties/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Foursquare Android SDK</title>
		<link>http://www.jiramot.info/foursquare-android-sdk</link>
		<comments>http://www.jiramot.info/foursquare-android-sdk#comments</comments>
		<pubDate>Tue, 29 Mar 2011 14:39:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[foursquare]]></category>

		<guid isPermaLink="false">http://www.jiramot.info/?p=945</guid>
		<description><![CDATA[<p>This is site for Foursquare Android SDK</p> <p>This page is under construct.</p> <p>To check out source from github https://github.com/jiramot/foursquare-android-sdk</p> <p>Thanks. Jiramot Numnam Thailand</p> ]]></description>
			<content:encoded><![CDATA[<p>This is site for Foursquare Android SDK</p>
<p>This page is under construct.</p>
<p>To check out source from github <a target="_blank" rel="nofollow" href="http://www.jiramot.info/goto/https://github.com/jiramot/foursquare-android-sdk" >https://github.com/jiramot/foursquare-android-sdk</a></p>
<p>Thanks.<br />
Jiramot Numnam<br />
Thailand</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiramot.info/foursquare-android-sdk/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>TableLayout</title>
		<link>http://www.jiramot.info/android-tablelayout</link>
		<comments>http://www.jiramot.info/android-tablelayout#comments</comments>
		<pubDate>Wed, 23 Mar 2011 15:20:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://www.jiramot.info/?p=932</guid>
		<description><![CDATA[ &#60;TableLayout android:layout_width=&#34;fill_parent&#34; android:layout_height=&#34;fill_parent&#34; xmlns:android=&#34;http://schemas.android.com/apk/res/android&#34;&#62; &#60;TableRow&#62; &#60;Button android:id=&#34;@+id/backbutton&#34; android:text=&#34;Back&#34; android:layout_width=&#34;wrap_content&#34; android:layout_height=&#34;wrap_content&#34; /&#62; &#60;/TableRow&#62; &#60;TableRow&#62; &#60;TextView android:text=&#34;First Name&#34; android:layout_width=&#34;wrap_content&#34; android:layout_height=&#34;wrap_content&#34; android:layout_column=&#34;1&#34; /&#62; &#60;EditText android:width=&#34;100px&#34; android:layout_width=&#34;wrap_content&#34; android:layout_height=&#34;wrap_content&#34; /&#62; &#60;/TableRow&#62; &#60;TableRow&#62; &#60;TextView android:text=&#34;Last Name&#34; android:layout_width=&#34;wrap_content&#34; android:layout_height=&#34;wrap_content&#34; android:layout_column=&#34;1&#34; /&#62; &#60;EditText android:width=&#34;100px&#34; android:layout_width=&#34;wrap_content&#34; android:layout_height=&#34;wrap_content&#34; /&#62; &#60;/TableRow&#62; &#60;/TableLayout&#62; <p></p> ]]></description>
			<content:encoded><![CDATA[
<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;TableLayout</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;">xmlns:android</span>=<span style="color: #ff0000;">&quot;http://schemas.android.com/apk/res/android&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TableRow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Button</span> </span>
<span style="color: #009900;">	    	<span style="color: #000066;">android:id</span>=<span style="color: #ff0000;">&quot;@+id/backbutton&quot;</span></span>
<span style="color: #009900;">	    	<span style="color: #000066;">android:text</span>=<span style="color: #ff0000;">&quot;Back&quot;</span></span>
<span style="color: #009900;">	    	<span style="color: #000066;">android:layout_width</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span></span>
<span style="color: #009900;">	    	<span style="color: #000066;">android:layout_height</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/TableRow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TableRow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TextView</span></span>
<span style="color: #009900;">	    	<span style="color: #000066;">android:text</span>=<span style="color: #ff0000;">&quot;First Name&quot;</span></span>
<span style="color: #009900;">	    	<span style="color: #000066;">android:layout_width</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span></span>
<span style="color: #009900;">	    	<span style="color: #000066;">android:layout_height</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span></span>
<span style="color: #009900;">	    	<span style="color: #000066;">android:layout_column</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;EditText</span></span>
<span style="color: #009900;">	    	<span style="color: #000066;">android:width</span>=<span style="color: #ff0000;">&quot;100px&quot;</span></span>
<span style="color: #009900;">	    	<span style="color: #000066;">android:layout_width</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span></span>
<span style="color: #009900;">	    	<span style="color: #000066;">android:layout_height</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/TableRow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TableRow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TextView</span></span>
<span style="color: #009900;">	    	<span style="color: #000066;">android:text</span>=<span style="color: #ff0000;">&quot;Last Name&quot;</span></span>
<span style="color: #009900;">	    	<span style="color: #000066;">android:layout_width</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span></span>
<span style="color: #009900;">	    	<span style="color: #000066;">android:layout_height</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span></span>
<span style="color: #009900;">	    	<span style="color: #000066;">android:layout_column</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;EditText</span></span>
<span style="color: #009900;">	    	<span style="color: #000066;">android:width</span>=<span style="color: #ff0000;">&quot;100px&quot;</span></span>
<span style="color: #009900;">	    	<span style="color: #000066;">android:layout_width</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span></span>
<span style="color: #009900;">	    	<span style="color: #000066;">android:layout_height</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/TableRow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/TableLayout<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p><a href="http://www.jiramot.info/wp-content/uploads/2011/03/android-tablelayout.png" ><img src="http://www.jiramot.info/wp-content/uploads/2011/03/android-tablelayout.png" alt="" title="TableLayout" width="331" height="491" class="aligncenter size-full wp-image-939" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jiramot.info/android-tablelayout/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

