<?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"
	>

<channel>
	<title>Warrior Point</title>
	<atom:link href="http://www.warriorpoint.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.warriorpoint.com/blog</link>
	<description>Latest News and Tutorials on Salesforce.com, SaaS, and on-demand software</description>
	<pubDate>Wed, 20 Jul 2011 23:26:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Android Samsung Nexus S: Short Review</title>
		<link>http://www.warriorpoint.com/blog/2011/07/10/android-samsung-nexus-s-short-review/</link>
		<comments>http://www.warriorpoint.com/blog/2011/07/10/android-samsung-nexus-s-short-review/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 03:21:35 +0000</pubDate>
		<dc:creator>Boyan Tsolov</dc:creator>
		
		<category><![CDATA[Android]]></category>

		<category><![CDATA[Nexus S]]></category>

		<guid isPermaLink="false">http://www.warriorpoint.com/blog/?p=422</guid>
		<description><![CDATA[
I&#8217;ve been neglecting the blog for a while.. sorry RSS subscribers.
I bought the HTC Magic 2 years ago when it first came out in Canada. That&#8217;s why most of my blog posts about Android development are from 2 years ago :).
I decided it was time to get the latest and greatest Android phone in Canada: [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_424" class="wp-caption alignleft" style="width: 209px"><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2011/07/nexuss.jpg"><img class="size-medium wp-image-424" title="Android Samsung Nexus S" src="http://www.warriorpoint.com/blog/wp-content/uploads/2011/07/nexuss-199x300.jpg" alt="Android Samsung Nexus S" width="199" height="300" /></a><p class="wp-caption-text">Android Samsung Nexus S</p></div></p>
<p>I&#8217;ve been neglecting the blog for a while.. sorry RSS subscribers.</p>
<p>I bought the HTC Magic 2 years ago when it first came out in Canada. That&#8217;s why most of my blog posts about Android development are from 2 years ago :).</p>
<p>I decided it was time to get the latest and greatest Android phone in Canada: the <strong>NEXUS S</strong>. A friend currently working at Google on Android highly recommended the device. And the fact that the phone is unlocked, Rogers will not put its apps on it, and Google will push updates directly to the phone without Rogers mandating when, made it even easier to pay the $300. In Canada the phone currently sells for $99 on a brand new contract, but you know how North America works: if you already have a contract you are not as enticing to the carriers as a brand new client with no contract. So, I had to pay a few fees to get the phone for $300 instead of $100.</p>
<p>I won&#8217;t go into a full review of the phone. There are plenty of sites that review the phone and have been doing it since the beginning of the year. I will only review a couple of items that I was worried about and you might be too if you are looking at getting this phone (or just got it).</p>
<p><span id="more-422"></span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Item 1: Overall</strong></p>
<p>Overall I am extremely happy. The problem with my HTC Magic was that it was getting slower and slower with every update and every app. It was still running Eclair. So many new technological advancements (and apps) have appeared in the past 2 years, I was ready to take them head on with a new phone!</p>
<p>&nbsp;</p>
<p><strong>Item 2: There is no notification light</strong></p>
<p><div id="attachment_425" class="wp-caption alignleft" style="width: 209px"><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2011/07/noled.jpg"><img class="size-medium wp-image-425 " title="NoLED App" src="http://www.warriorpoint.com/blog/wp-content/uploads/2011/07/noled-199x300.jpg" alt="NoLED App" width="199" height="300" /></a><p class="wp-caption-text">NoLED App</p></div></p>
<p>This is not new; a few of the other Samsung Androids also don&#8217;t have a notification light. I loved seeing the button light up on the HTC Magic but I cannot do that any more. I downloaded an app called NoLED (<a href="http://www.appbrain.com/app/noled/com.led.notify" target="_blank">http://www.appbrain.com/app/noled/com.led.notify</a>). It works quite well. You set it up to monitor apps that would give you notifications, and the app lights up a few pixels (or icons) on your screen when you get a notification. I used it for about a week and then I decided to stop using it. I want to see how difficult it is for me to manually check my phone, without having my phone tell me that I have a notification. But I also stopped using it for 2 other reasons:</p>
<p>- In order for the few pixels to light up, the buttons on the phone light up. The picture on the left is a little blurry, but the top-left of the screen has a red dot lit up and the 4 buttons on the bottom lit up. I don&#8217;t like that the 4 buttons on the bottom light up. There is a Setting in the app to not light these buttons up, but I turned that setting on and, well, you can see they are still lit up. I might be wrong here, but I feel like it wastes my battery when the NoLED app lights up those few buttons- because it is &#8220;waking up&#8221; my phone. I don&#8217;t think it makes such a big difference to battery usage and I recharge my phone nightly regardless, but it bothered me to think that the phone screen was on for extended periods of time.</p>
<p>- To awake the screen and unlock the phone you have to press the physical button on the top-right, however when you get a notification you should NOT press the top-right button. Essentially the NoLED app wakes up your phone, so the screen is now turned on with just a pixel lit up, so if you press the button on the top-right you will turn off the screen, not unlock your phone. It took some time to get used to&#8230; I would see a notification, press the button in the top-right, the screen would turn off, I&#8217;d get pissed off, I would press the button again, the screen would turn on (with the NoLED pixel only), then I would press any of the 4 buttons at the bottom of the phone (e.g. the Home button) which would turn on the screen and allow me to slide the thingy over to unlock it.</p>
<p>Anyways, cool app, try it out. I&#8217;m going to try and see how I can live without a notification light.</p>
<p>&nbsp;</p>
<p><strong>Item 3: There is a weird green bar on the left of the phone</strong></p>
<p><div id="attachment_426" class="wp-caption alignleft" style="width: 209px"><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2011/07/greenline.jpg"><img class="size-medium wp-image-426" title="Thin Green Line" src="http://www.warriorpoint.com/blog/wp-content/uploads/2011/07/greenline-199x300.jpg" alt="Thin Green Line" width="199" height="300" /></a><p class="wp-caption-text">Thin Green Line</p></div></p>
<p>This scared me. I thought I had a faulty phone and had to return it - right after I got it! But after reading a few things online, it seems like the green line of 1 pixel on the left of the screen has something to do with the AMOLED screen. I tried to take a picture of it here, but I don&#8217;t think you can see much. It only appears if you look closely and only on light backgrounds. <a href="http://androidforums.com/samsung-fascinate/229454-green-line-screen.html" target="_blank">http://androidforums.com/samsung-fascinate/229454-green-line-screen.html</a></p>
<p>&nbsp;</p>
<p><strong>Item 4: Text messaging limit</strong></p>
<p>I had 4000+ text messages on my HTC Magic. Opening the  Messaging app would take 15 seconds every time I wanted to send or read a  message. Eventually I downloaded the app &#8220;Delete Old Messages&#8221;. It took 8 hours to delete 4000 messages. It seems that with Gingerbread, the Android team understood that too many text messages can make the app slow, so now there is a setting in the Messaging app to clean text messages on a regular basis. I plan to use this setting :).</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Item 5: Near Field Communication</strong></p>
<p><div id="attachment_427" class="wp-caption alignleft" style="width: 247px"><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2011/07/nfc.png"><img class="size-medium wp-image-427" title="NFC!!" src="http://www.warriorpoint.com/blog/wp-content/uploads/2011/07/nfc.png" alt="NFC!!" width="237" height="198" /></a><p class="wp-caption-text">NFC!!</p></div></p>
<p><a href="http://en.wikipedia.org/wiki/Near_field_communication" target="_blank">http://en.wikipedia.org/wiki/Near_field_communication</a>. To quote Steve Jobs, &#8220;This is going to change everything,.. again&#8221;. I love that all phones coming out have NFC readers and the Nexus S is one of the first (here in Canada at least). The technology is not new, and is being used in cellphones in Asia and Europe, but for the laggard Canada it is new and exciting! Soon you&#8217;ll be able to pay just by swiping your phone, and who knows what other uses will appear. Maybe you will be able to check in on FourSquare just by swiping your phone as you walk into a bar, rather than having to press anything on your screen.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>And conclusion</strong></p>
<p>That&#8217;s it for now. Great phone, I highly recommend it. I think I&#8217;m going to start playing with NFC now. Some links for other NFC enthusiasts:</p>
<ul>
<li><a href="http://stackoverflow.com/questions/4417911/where-can-i-buy-nfc-tags" target="_blank">http://stackoverflow.com/questions/4417911/where-can-i-buy-nfc-tags</a></li>
<li><a href="http://www.tagstand.com/" target="_blank">http://www.tagstand.com/</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2011/07/10/android-samsung-nexus-s-short-review/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Windows Phone 7: Beginner’s Guide to Developing on Windows Phone 7</title>
		<link>http://www.warriorpoint.com/blog/2010/09/26/windows-phone-7-beginner%e2%80%99s-guide-to-developing-on-windows-phone-7/</link>
		<comments>http://www.warriorpoint.com/blog/2010/09/26/windows-phone-7-beginner%e2%80%99s-guide-to-developing-on-windows-phone-7/#comments</comments>
		<pubDate>Sun, 26 Sep 2010 20:05:56 +0000</pubDate>
		<dc:creator>Boyan Tsolov</dc:creator>
		
		<category><![CDATA[Windows Phone 7]]></category>

		<guid isPermaLink="false">http://www.warriorpoint.com/blog/?p=396</guid>
		<description><![CDATA[
The official release date for Windows Phone 7 is October 11th (in the US). Word around the internet is that it will be released in Canada around the end of October / beginning of November. LG, Samsung, HTC, and Dell have all developed handsets that will be available in Canada. One of the services we [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-medium wp-image-397" title="iheartwp7" src="http://www.warriorpoint.com/blog/wp-content/uploads/2010/09/iheartwp7.png" alt="IHeartWP7" width="250" height="250" /></p>
<p>The official release date for Windows Phone 7 is October 11th (in the US). Word around the internet is that it will be released in Canada around the end of October / beginning of November. LG, Samsung, HTC, and Dell have all developed handsets that will be available in Canada. One of the services we offer at <a href="http://www.imason.com">my place of employment</a> is mobile development and since we are a Microsoft Gold Partner, developing on Windows Phone 7 is our forte (actually it’s the only mobile development we do). I assume as this platform gets bigger more people will jump to learn how to program on it, so this is a quick-and-dirty list of resources that will help you to learn about programming on Windows Phone 7.</p>
<ol>
<li><a href="http://developer.windowsphone.com/" target="_blank">http://developer.windowsphone.com/</a><br />
If you are a developer, the first thing you need to do is visit the developer’s home page. You can download tools from here, read about the SDK, look at sample code, and get questions answered in the forums.</li>
<li><a href="http://silverlight.codeplex.com/releases" target="_blank">http://silverlight.codeplex.com/releases</a><br />
You must download the Silverlight Toolkit for Windows Phone 7. It has alot of great Silverlight controls that will make your app much cooler. For example, the version of the SDK and Silverlight that you get from the first link does not have a calendar control. The Toolkit from this link has a DatePicker and a TimePicker control that you can just plop on your page and use.</li>
<li><a href="http://channel9.msdn.com/Learn/Courses/WP7TrainingKit" target="_blank">http://channel9.msdn.com/Learn/Courses/WP7TrainingKit</a><br />
The best place I have found for guides, best practices, code samples, etc was Channel9. This is the home page.</li>
<li><a href="http://channel9.msdn.com/Learn/Courses/WP7TrainingKit/WP7Silverlight" target="_blank">http://channel9.msdn.com/Learn/Courses/WP7TrainingKit/WP7Silverlight</a><br />
I particularly like the home page for Silverlight on WP7. There are a ton of tutorials here, the ones I found most useful are listed below.</li>
<li><a href="http://channel9.msdn.com/Learn/Courses/WP7TrainingKit/WP7Silverlight/WindowsPhoneNavigationAndControlsLab" target="_blank">http://channel9.msdn.com/Learn/Courses/WP7TrainingKit/WP7Silverlight/WindowsPhoneNavigationAndControlsLab</a><br />
How to handle navigation, going back and forth between pages, the best practices for setting up your pages.</li>
<li><a href="http://channel9.msdn.com/Learn/Courses/WP7TrainingKit/WP7Silverlight/ApplicationLifetimeWP7Lab" target="_blank">http://channel9.msdn.com/Learn/Courses/WP7TrainingKit/WP7Silverlight/ApplicationLifetimeWP7Lab</a><br />
Very important read on the application life cycle of a WP7 app.</li>
<li><a href="http://channel9.msdn.com/Learn/Courses/WP7TrainingKit/WP7Silverlight/LaunchersAndChoosersWP7Lab" target="_blank">http://channel9.msdn.com/Learn/Courses/WP7TrainingKit/WP7Silverlight/LaunchersAndChoosersWP7Lab<br />
</a>Working with launchers and choosers. Launchers and choosers are parts ofthe API that allow you interact with the Windows Phone 7 first-partyapps, such as the email client, calendar/agenda, contact list, messaging app, etc.</li>
<li><a href="http://channel9.msdn.com/Learn/Courses/WP7TrainingKit/WP7Silverlight/UsingPivotAndPanoramaControls" target="_blank">http://channel9.msdn.com/Learn/Courses/WP7TrainingKit/WP7Silverlight/UsingPivotAndPanoramaControls<br />
</a>This tutorial shows you how to make your apps have the cool Windows Phone 7 feel with the sliding between screens (called pivot and panorama controls).</li>
<li><a href="http://www.silverlight.net/learn/videos/all/windows-phone-application-bar/" target="_blank">http://www.silverlight.net/learn/videos/all/windows-phone-application-bar/<br />
</a>Great tutorial video on how to set up the application bar at the bottom of your app. The video also shows the different customizations that you can do to the application bar.</li>
<li><a href="http://channel9.msdn.com/Blogs/SlickThought/Simplify-Page-Transitions-in-Windows-Phone-7-Silverlight-Applications" target="_blank">http://channel9.msdn.com/Blogs/SlickThought/Simplify-Page-Transitions-in-Windows-Phone-7-Silverlight-Applications<br />
</a>Getting the cool fade-in, fade-out page transitions to work. This effect is done by using the TransitioningContentControl that comes with the Silverlight toolkit (an extra install from link #2). Note: this tutorial was done on the April release of the Windows Phone 7 SDK, the latest SDK is slightly different.</li>
<li><a href="http://channel9.msdn.com/blogs/slickthought/custom-per-page-transitions-for-windows-phone-7" target="_blank"><span id="more-396"></span>http://channel9.msdn.com/blogs/slickthought/custom-per-page-transitions-for-windows-phone-7<br />
</a>Similar to the previous link, this shows a little bit more about fancy, animated page transitions.</li>
<li><a href="http://blogs.msdn.com/b/avip/archive/2010/04/03/windows-phone-frame-page-navigation-and-transitions-using-the-transitioningcontentcontrol.aspx" target="_blank">http://blogs.msdn.com/b/avip/archive/2010/04/03/windows-phone-frame-page-navigation-and-transitions-using-the-transitioningcontentcontrol.aspx<br />
</a>This is another link on page transitions by using the TransitioningContentControl. However, it also uses the April release.</li>
<li><a href="http://www.viddler.com/explore/pagebrooks/videos/10/" target="_blank">http://www.viddler.com/explore/pagebrooks/videos/10/<br />
</a>This video tutorial describes how to create a splash screen for you Windows Phone 7 application. It’s quite simple actually.</li>
<li><a href="http://mobileworld.appamundi.com/blogs/andywigley/archive/2010/07/12/migrating-wp7-april-ctp-projects-to-wp7-beta.aspx" target="_blank">http://mobileworld.appamundi.com/blogs/andywigley/archive/2010/07/12/migrating-wp7-april-ctp-projects-to-wp7-beta.aspx<br />
</a>There are differences between the April CTP release and the July release of the Windows Phone 7 SDK. This blog post describes a couple of steps to convert older projects to the new version. Obviously if you are just starting out you do not need this, but if you find sample code on the internet, you might need these steps to get the code working on your machine.</li>
</ol>
<p>If you are just starting out, then these links (and probably a couple of days of your time) will be sufficient to introduce you into the structure, framework, best practices, and common utilities for Windows Phone 7. And now I’m off to try and get my own TransitioningContentControl to work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2010/09/26/windows-phone-7-beginner%e2%80%99s-guide-to-developing-on-windows-phone-7/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Samsung may drop Windows Mobile and switch to Android</title>
		<link>http://www.warriorpoint.com/blog/2009/11/10/samsung-may-drop-windows-mobile-and-switch-to-android/</link>
		<comments>http://www.warriorpoint.com/blog/2009/11/10/samsung-may-drop-windows-mobile-and-switch-to-android/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 03:36:52 +0000</pubDate>
		<dc:creator>Boyan Tsolov</dc:creator>
		
		<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://www.warriorpoint.com/blog/?p=388</guid>
		<description><![CDATA[I just found this article from reddit&#8230;
Samsung may drop Windows Mobile for Android
Apparently Samsung is going to stop using Windows Mobile on its cellphones and will concentrate on Android!! I have been a supporter of Android since its inception and stories like these bring tears of joy to my eyes.
Oh, and there&#8217;s something about Samsung [...]]]></description>
			<content:encoded><![CDATA[<p>I just found this article from reddit&#8230;<br />
<a href="http://www.wiseandroid.com/NewsItem.aspx?category=News&amp;path=November&amp;itemid=16" target="_blank">Samsung may drop Windows Mobile for Android</a></p>
<p>Apparently Samsung is going to stop using Windows Mobile on its cellphones and will concentrate on Android!! I have been a supporter of Android since its inception and stories like these bring tears of joy to my eyes.</p>
<p>Oh, and there&#8217;s something about Samsung rolling out their own open source OS called &#8220;Bada&#8221;. Good for them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2009/11/10/samsung-may-drop-windows-mobile-and-switch-to-android/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Android: Simplified source code for parsing and working with XML data and web services in Android</title>
		<link>http://www.warriorpoint.com/blog/2009/07/19/android-simplified-source-code-for-parsing-and-working-with-xml-data-and-web-services-in-android/</link>
		<comments>http://www.warriorpoint.com/blog/2009/07/19/android-simplified-source-code-for-parsing-and-working-with-xml-data-and-web-services-in-android/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 02:05:24 +0000</pubDate>
		<dc:creator>Boyan Tsolov</dc:creator>
		
		<category><![CDATA[Android]]></category>

		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://www.warriorpoint.com/blog/?p=378</guid>
		<description><![CDATA[In my previous post I linked to a terrific website (Working with XML on Android) which describes how you can read and parse XML documents in Android. The code supplied by that website used polymorphism to show 4 different methods for parsing the XML data. I vowed to simplify that and share the new source [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://www.warriorpoint.com/blog/2009/07/19/android-reading-using-and-working-with-xml-data-and-web-services-in-android/" target="_blank">previous post</a> I linked to a terrific website (<a title="http://www.ibm.com/developerworks/opensource/library/x-android/index.html?ca=dgr-lnxw82Android-XML&amp;S_TACT=105AGX59&amp;S_CMP=grlnxw82" href="http://www.ibm.com/developerworks/opensource/library/x-android/index.html?ca=dgr-lnxw82Android-XML&amp;S_TACT=105AGX59&amp;S_CMP=grlnxw82" target="_blank">Working with XML on Android</a>) which describes how you can read and parse XML documents in Android. The code supplied by that website used polymorphism to show 4 different methods for parsing the XML data. I vowed to simplify that and share the new source code.</p>
<p>To <a href="http://www.warriorpoint.com/blog/downloads/" target="_blank">download the AndroidXmlSimple project click here</a>. You will be taken to another page where you can click to download to the ZIP file.</p>
<p>Below are some instructions on setting yourself up with this source code and customizing it for your own XML data.</p>
<p> <span id="more-378"></span>
<p>1. Download the file AndroidXmlSimple.zip</p>
<p>2. Unzip it on your disk.</p>
<p>3. Open Eclipse and import the Android project into your workspace.</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/07/01import1.jpg"><img title="01 Import" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="456" alt="01 Import" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/07/01import-thumb1.jpg" width="388" border="0" /></a> </p>
<p>4. The project will look like this:</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/07/02project1.jpg"><img title="02 project" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="440" alt="02 project" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/07/02project-thumb1.jpg" width="391" border="0" /></a> </p>
<p>5. This new project opens up an XML document (the same RSS feed as the original example) and displays it using a ListActivity.</p>
<p>6. The classes are:</p>
<p>- MessageList.java: the main Activity</p>
<p>- Message.java: object that stores the parsed XML data</p>
<p>- RssHandler.java: object that parses the XML data</p>
<p>- BaseFeedParser.java: object that initiates the starting point and configurations for the XML data that should be parsed. </p>
<p>7. To customize this project for your own feed, edit the file BaseFeedParser.java.</p>
<p>Update the URL location here:</p>
<pre class="csharpcode" style="width: 69.26%; height: 45px"><span class="kwrd">static</span> String feedUrlString = <span class="str">&quot;http://www.androidster.com/android_news.rss&quot;</span>;</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Update the hierarchy of nodes here:</p>
<pre class="csharpcode" style="width: 64.36%; height: 75px"><span class="kwrd">static</span> final String RSS = <span class="str">&quot;rss&quot;</span>;
<span class="kwrd">static</span> final String CHANNEL = <span class="str">&quot;channel&quot;</span>;
<span class="kwrd">static</span> final String ITEM = <span class="str">&quot;item&quot;</span>;</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Update the node names that repeat here:</p>
<pre class="csharpcode" style="width: 65.33%; height: 98px"><span class="kwrd">static</span> final String PUB_DATE = <span class="str">&quot;pubDate&quot;</span>;
<span class="kwrd">static</span> final String DESCRIPTION = <span class="str">&quot;description&quot;</span>;
<span class="kwrd">static</span> final String LINK = <span class="str">&quot;link&quot;</span>;
<span class="kwrd">static</span> final String TITLE = <span class="str">&quot;title&quot;</span>;</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>And as in the previous post, if you change any names of the constants, you will need to update other sections of the code-base, for example below in BaseFeedParser.java, and in a few places in RssHandler.java.</p>
<pre class="csharpcode" style="width: 68.29%; height: 372px">        item.getChild(TITLE).setEndTextElementListener(<span class="kwrd">new</span> EndTextElementListener(){
            <span class="kwrd">public</span> <span class="kwrd">void</span> end(String body) {
                currentMessage.setTitle(body);
            }
        });
        item.getChild(LINK).setEndTextElementListener(<span class="kwrd">new</span> EndTextElementListener(){
            <span class="kwrd">public</span> <span class="kwrd">void</span> end(String body) {
                currentMessage.setLink(body);
            }
        });
        item.getChild(DESCRIPTION).setEndTextElementListener(<span class="kwrd">new</span> EndTextElementListener(){
            <span class="kwrd">public</span> <span class="kwrd">void</span> end(String body) {
                currentMessage.setDescription(body);
            }
        });
        item.getChild(PUB_DATE).setEndTextElementListener(<span class="kwrd">new</span> EndTextElementListener(){
            <span class="kwrd">public</span> <span class="kwrd">void</span> end(String body) {
                currentMessage.setDate(body);
            }
        });</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>&#160;</p>
<p>Please leave a comment if you download this ZIP file – I’d like to know if you found this useful. And let me know if it does what you expected after reading my post. Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2009/07/19/android-simplified-source-code-for-parsing-and-working-with-xml-data-and-web-services-in-android/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Android: Reading, using and working with XML data and web services in Android</title>
		<link>http://www.warriorpoint.com/blog/2009/07/19/android-reading-using-and-working-with-xml-data-and-web-services-in-android/</link>
		<comments>http://www.warriorpoint.com/blog/2009/07/19/android-reading-using-and-working-with-xml-data-and-web-services-in-android/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 00:37:33 +0000</pubDate>
		<dc:creator>Boyan Tsolov</dc:creator>
		
		<category><![CDATA[Android]]></category>

		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://www.warriorpoint.com/blog/?p=363</guid>
		<description><![CDATA[One of the most powerful aspects of any mobile application for a 3G phone is that it can connect to the Internet. By connecting to the Internet the application can offer much more value to the user since it becomes an interface for a web-based component, e.g. using Twitter’s API to create a Twitter application [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most powerful aspects of any mobile application for a 3G phone is that it can connect to the Internet. By connecting to the Internet the application can offer much more value to the user since it becomes an interface for a web-based component, e.g. using Twitter’s API to create a Twitter application so that you can get your Twitter updates without having to open the mobile browser. The most common way of interfacing with a web-based component is by using web services in XML format.</p>
<p>While trying to developer my own app which reads a web service from my own server, I ran into a lot of difficulties in implementing the client that consumes the web service. Android does not have libraries for XPath handling of XML documents, so it makes deciphering XML data a little bit more difficult. From what I’ve read online the Android team is currently working on including such libraries in future versions.</p>
<p>After some digging around I found an amazing link that shows different methods for consuming an XML file in Android and parsing through it without the use of XPaths. The link is this: <a title="http://www.ibm.com/developerworks/opensource/library/x-android/index.html?ca=dgr-lnxw82Android-XML&amp;S_TACT=105AGX59&amp;S_CMP=grlnxw82" href="http://www.ibm.com/developerworks/opensource/library/x-android/index.html?ca=dgr-lnxw82Android-XML&amp;S_TACT=105AGX59&amp;S_CMP=grlnxw82" target="_blank">Working with XML on Android</a>. To start off, this link is an absolute must-read. Everything that I am going to write in my post here relates to this link. The code offered on that webpage uses polymorphism to show you 4 different methods of working with XML data. It provides a fully-functional Android application and all the source code for it. The source code can be found here: <a title="http://www.ibm.com/developerworks/apps/download/index.jsp?contentid=398121&amp;filename=AndroidXml.zip&amp;method=http&amp;locale=worldwide" href="http://www.ibm.com/developerworks/apps/download/index.jsp?contentid=398121&amp;filename=AndroidXml.zip&amp;method=http&amp;locale=worldwide">AndroidXML.zip</a>.</p>
<p>My post today will concentrate on how to customize the code from the application in the above link, in order to read and parse your own XML data. If you are a Java pro, you might not need this post. My Java is a little rusty, so I needed some time to figure out exactly what I had to change and where in order to get this to work with my own web service XML. Now that I’ve figured it out, I thought I’d share it. In my next post I will give the simplified version of this code – where there is no polymorphism, and thus there are only the minimum number of classes needed to implement this XML-reading solution. I can’t offer this simplified code right now – because I haven’t coded it yet :).</p>
<p>So until I post the simplified source code for working with XML data in Android, here are some tips on getting through the larger polymorphism-based source code and customizing it for your own XML data:</p>
<p><span id="more-363"></span></p>
<p>1. First off, read over the link <a title="http://www.ibm.com/developerworks/opensource/library/x-android/index.html?ca=dgr-lnxw82Android-XML&amp;S_TACT=105AGX59&amp;S_CMP=grlnxw82" href="http://www.ibm.com/developerworks/opensource/library/x-android/index.html?ca=dgr-lnxw82Android-XML&amp;S_TACT=105AGX59&amp;S_CMP=grlnxw82" target="_blank">Working with XML on Android</a> as much as you can.</p>
<p>2. Download the source code for the Android application that they offer: <a title="http://www.ibm.com/developerworks/apps/download/index.jsp?contentid=398121&amp;filename=AndroidXml.zip&amp;method=http&amp;locale=worldwide" href="http://www.ibm.com/developerworks/apps/download/index.jsp?contentid=398121&amp;filename=AndroidXml.zip&amp;method=http&amp;locale=worldwide">AndroidXML.zip</a>.</p>
<p>3. Import the project into your Eclipse workspace by right-clicking in Project Explorer and selecting “Import”.</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/07/01import.jpg"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="01 Import" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/07/01import-thumb.jpg" border="0" alt="01 Import" width="426" height="502" /></a></p>
<p>4. Select “Existing Projects into Workspace”</p>
<p>5. Browse to the directory where you extracted the ZIP file with the source code and then click on the Next buttons to finish off the wizard. The project is called “AndroidXml”.</p>
<p>6. You will now see the project in your workspace:</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/07/02project.jpg"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="02 project" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/07/02project-thumb.jpg" border="0" alt="02 project" width="370" height="533" /></a></p>
<p>7. Here is a quick breakdown of what some of those Java classes do:</p>
<p>- MessageList.java is the main activity that gets started. It lists the items from the XML data using a ListActivity. In this project the items come from an RSS feed.</p>
<p>- FeedParser.java, FeedParserFactory.java, BaseFeedParser.java, RSSHandler.hava are all classes that this particular example uses to set the framework for polymorphism.</p>
<p>- This example uses 4 methods for grabbing the XML data and reading it.The 4 methods that this example uses are:</p>
<blockquote><p>1. AndroidSaxFeedParser.java (the default)</p>
<p>2. DomFeedParser.java</p>
<p>3. SaxFeedParser.java</p>
<p>4. XmlPullFeedParser.java</p></blockquote>
<p>These 4 classes all extend BaseFeedParser.java.</p>
<p>8. In order to customize this for your own XML file you need to edit the following places (assuming you are using AndroidSaxFeedParser, which is the default):</p>
<p>- FeedParserFactory.java: you need to change the URL location of the web service or XML document in the global variable here:</p>
<pre class="csharpcode" style="width: 65.22%; height: 29px;"><span class="kwrd">static</span> String feedUrl = <span class="str">"http://www.androidster.com/android_news.rss"</span>;</pre>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>- AndroidSaxFeedParser.java: you need to change the root node of your XML document. This is stored in the String called RSS.</p>
<pre class="csharpcode" style="width: 65.05%; height: 30px;"><span class="kwrd">static</span> final String RSS = <span class="str">"RootNode"</span>;</pre>
<p>- BaseFeedParser.java: you need to change this class according to the nodes that your XML document has.</p>
<p>The nodes CHANNEL and ITEM refer to the nodes &lt;Channel&gt; and &lt;Item&gt; in the RSS feed that this example uses. You need to change them to mimic your nodes from your XML document:</p>
<pre class="csharpcode" style="width: 65%; height: 43px;"><span class="kwrd">static</span> final String CHANNEL = <span class="str">"channel"</span>;
<span class="kwrd">static</span> final  String ITEM = <span class="str">"item"</span>;</pre>
<p>The other constants that are declared refer to the nodes for each repeating item.<br />
<!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<pre class="csharpcode" style="width: 65.28%; height: 83px;"><span class="kwrd">static</span> final  String PUB_DATE = <span class="str">"pubDate"</span>;
<span class="kwrd">static</span> final  String DESCRIPTION = <span class="str">"description"</span>;
<span class="kwrd">static</span> final  String LINK = <span class="str">"link"</span>;
<span class="kwrd">static</span> final  String TITLE = <span class="str">"title"</span>;</pre>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --> <!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>For this particular example, since an RSS feed XML document is used, it has repeating nodes for &lt;Description&gt;, &lt;Link&gt;, &lt;Title&gt;, &lt;PubDate&gt;. You need to change this structure to mimic your structure.</p>
<p>Note: Remember that if you change the name of the constants (as opposed to the value of the constants), you will need to change other classes which call these constants.<br />
<!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>- If you change the names of the constants, you will have to update AndroidSaxFeedParser.java in this section:</p>
<pre class="csharpcode" style="width: 67.45%; height: 343px;">        item.getChild(TITLE).setEndTextElementListener(<span class="kwrd">new</span> EndTextElementListener(){
            <span class="kwrd">public</span> <span class="kwrd">void</span> end(String body) {
                currentMessage.setTitle(body);
            }
        });
        item.getChild(LINK).setEndTextElementListener(<span class="kwrd">new</span> EndTextElementListener(){
            <span class="kwrd">public</span> <span class="kwrd">void</span> end(String body) {
                currentMessage.setLink(body);
            }
        });
        item.getChild(DESCRIPTION).setEndTextElementListener(<span class="kwrd">new</span> EndTextElementListener(){
            <span class="kwrd">public</span> <span class="kwrd">void</span> end(String body) {
                currentMessage.setDescription(body);
            }
        });
        item.getChild(PUB_DATE).setEndTextElementListener(<span class="kwrd">new</span> EndTextElementListener(){
            <span class="kwrd">public</span> <span class="kwrd">void</span> end(String body) {
                currentMessage.setDate(body);
            }
        });</pre>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>As you can see this section is hardcoded for the 4 nodes that are expected in this XML document (TITLE, LINK, DESCRIPTION, PUB_DATE). You will need to change this section and hardcode this for your own nodes.</p>
<p>- If you change the names of the higher-level nodes, i.e. &lt;Channel&gt; and &lt;Item&gt;, then you need to update the following section of AndroidSaxFeedParser.java:</p>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<pre class="csharpcode" style="width: 65.08%; height: 49px;">Element itemlist = root.getChild(CHANNEL);
Element item = itemlist.getChild(ITEM);</pre>
<p>And that is all. The customized code will use the AndroidSaxParser implementation of an XML Parser, it will go to the URL you provided in FeedParserFactory.java, and it will iterate through the updated nodes as you have labeled them in BaseFeedParser.java and AndroidSaxFeedParser.java.</p>
<p>In my next post I will provide a simplified version of this code, which does not use polymorphism. It will (hopefully) use the minimum required classes to get XML data and parse it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2009/07/19/android-reading-using-and-working-with-xml-data-and-web-services-in-android/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Android: Creating TableRow rows inside a TableLayout programatically</title>
		<link>http://www.warriorpoint.com/blog/2009/07/01/android-creating-tablerow-rows-inside-a-tablelayout-programatically/</link>
		<comments>http://www.warriorpoint.com/blog/2009/07/01/android-creating-tablerow-rows-inside-a-tablelayout-programatically/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 02:07:39 +0000</pubDate>
		<dc:creator>Boyan Tsolov</dc:creator>
		
		<category><![CDATA[Android]]></category>

		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://www.warriorpoint.com/blog/?p=353</guid>
		<description><![CDATA[In my quest to create a “Taxman” Android application I ran into the following problem:
I want to ask the user to enter their yearly income, after which the screen will flip and their after-tax income will be displayed in a table format for all Canadian provinces. (And for the future: all US states). The problem [...]]]></description>
			<content:encoded><![CDATA[<p>In my quest to create a “Taxman” Android application I ran into the following problem:</p>
<p>I want to ask the user to enter their yearly income, after which the screen will flip and their after-tax income will be displayed in a table format for all Canadian provinces. (And for the future: all US states). The problem I ran into is creating a TableRow for each Canadian province in my main.xml. There are 13 provinces and territories, so 13 is not that bad to copy &amp; paste in the main.xml; however, as soon as I have to copy &amp; paste more than 2 times I start cringing and nausea kicks in. Personally I think “copy &amp; paste” should not be in the programming vocabulary. Not only that, but I have 13 provinces now, what about when I have to enter 50 states! So, I had to find a way to create these new TableRow rows programmatically inside my TableLayout layout.</p>
<p>A great source for code snippets and answers to Android questions is <a title="http://www.anddev.org" href="http://www.anddev.org">http://www.anddev.org</a>. I’m sure if you’re dabbling with Android then you’ve already come across this site. The particular post I read to do this is this one: <a title="http://www.anddev.org/viewtopic.php?p=3404" href="http://www.anddev.org/viewtopic.php?p=3404" target="_blank">Dynamically add rows to TableLayout</a>. Commenters on that post were having problems getting this to work, but after I imported all the correct classes (android.widget.TableRow.LayoutParams is an important one to use) everything worked from the first time. I forced Eclipse to find most of the classes for me.</p>
<p>Below is the code from anddev.org, with my changes for my Taxman Android app. I’m too lazy to do a full-out beginning-to-end tutorial for this code snippet.</p>
<p>First I set my constants at the top of the Activity class:</p>
<pre class="csharpcode" style="width: 65.27%; height: 273px;"><span class="kwrd">public</span> <span class="kwrd">class</span> Activity1 extends Activity implements OnTouchListener{

    <span class="kwrd">int</span> PROVINCE_Alberta = 0;
    <span class="kwrd">int</span> PROVINCE_BC = 1;
    <span class="kwrd">int</span> PROVINCE_Manitoba = 2;
    <span class="kwrd">int</span> PROVINCE_NewBrunswick = 3;
    <span class="kwrd">int</span> PROVINCE_Newfoundland = 4;
    <span class="kwrd">int</span> PROVINCE_Northwest = 5;
    <span class="kwrd">int</span> PROVINCE_NovaScotia = 6;
    <span class="kwrd">int</span> PROVINCE_Nunavut = 7;
    <span class="kwrd">int</span> PROVINCE_Ontario = 8;
    <span class="kwrd">int</span> PROVINCE_PEI = 9;
    <span class="kwrd">int</span> PROVINCE_Quebec = 10;
    <span class="kwrd">int</span> PROVINCE_Saskatchewan = 11;
    <span class="kwrd">int</span> PROVINCE_Yukon = 12;

    <span class="kwrd">int</span> numProvinces = 13;</pre>
<p><span id="more-353"></span></p>
<p>There are 13 of them this time, there will be 50 of them for the States… technically this could be made into something much more malleable like an external config-type XML file.</p>
<p>Then in the onCreate method I created an array of String objects that will house all these provinces:</p>
<pre class="csharpcode" style="width: 65.25%; height: 225px;">        String[] provinces = <span class="kwrd">new</span> String[numProvinces];
        provinces[PROVINCE_Alberta] = <span class="str">"Alberta"</span>;
        provinces[PROVINCE_BC] = <span class="str">"British Columbia"</span>;
        provinces[PROVINCE_Manitoba] = <span class="str">"Manitoba"</span>;
        provinces[PROVINCE_NewBrunswick] = <span class="str">"New Brunswick"</span>;
        provinces[PROVINCE_Newfoundland] = <span class="str">"Newfoundland and Labrador"</span>;
        provinces[PROVINCE_Northwest] = <span class="str">"Northwest Territories"</span>;
        provinces[PROVINCE_NovaScotia] = <span class="str">"Nova Scotia"</span>;
        provinces[PROVINCE_Nunavut] = <span class="str">"Nunavut"</span>;
        provinces[PROVINCE_Ontario] = <span class="str">"Ontario"</span>;
        provinces[PROVINCE_PEI] = <span class="str">"Prince Edward Island"</span>;
        provinces[PROVINCE_Quebec] = <span class="str">"Quebec"</span>;
        provinces[PROVINCE_Saskatchewan] = <span class="str">"Saskatchewan"</span>;
        provinces[PROVINCE_Yukon] =  <span class="str">"Yukon"</span>;</pre>
<p>And right underneath that I create a TableRow for each item in the array provinces:</p>
<pre class="csharpcode" style="width: 65.42%; height: 609px;">        <span class="rem">// Get the TableLayout</span>
        TableLayout tl = (TableLayout) findViewById(R.id.maintable);

        <span class="rem">// Go through each item in the array</span>
        <span class="kwrd">for</span> (<span class="kwrd">int</span> current = 0; current &lt; numProvinces; current++)
        {
            <span class="rem">// Create a TableRow and give it an ID</span>
            TableRow tr = <span class="kwrd">new</span> TableRow(<span class="kwrd">this</span>);
            tr.setId(100+current);
            tr.setLayoutParams(<span class="kwrd">new</span> LayoutParams(
                    LayoutParams.FILL_PARENT,
                    LayoutParams.WRAP_CONTENT));   

            <span class="rem">// Create a TextView to house the name of the province</span>
            TextView labelTV = <span class="kwrd">new</span> TextView(<span class="kwrd">this</span>);
            labelTV.setId(200+current);
            labelTV.setText(provinces[current]);
            labelTV.setTextColor(Color.BLACK);
            labelTV.setLayoutParams(<span class="kwrd">new</span> LayoutParams(
                    LayoutParams.FILL_PARENT,
                    LayoutParams.WRAP_CONTENT));
            tr.addView(labelTV);

            <span class="rem">// Create a TextView to house the value of the after-tax income</span>
            TextView valueTV = <span class="kwrd">new</span> TextView(<span class="kwrd">this</span>);
            valueTV.setId(current);
            valueTV.setText(<span class="str">"$0"</span>);
            valueTV.setTextColor(Color.BLACK);
            valueTV.setLayoutParams(<span class="kwrd">new</span> LayoutParams(
                    LayoutParams.FILL_PARENT,
                    LayoutParams.WRAP_CONTENT));
            tr.addView(valueTV);

            <span class="rem">// Add the TableRow to the TableLayout</span>
            tl.addView(tr, <span class="kwrd">new</span> TableLayout.LayoutParams(
                    LayoutParams.FILL_PARENT,
                    LayoutParams.WRAP_CONTENT));
        }</pre>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --> <!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>The main.xml contains the following for the TableLayout:</p>
<pre class="csharpcode" style="width: 65.56%; height: 121px;">        &lt;TableLayout xmlns:android=<span class="str">"http://schemas.android.com/apk/res/android"</span>
                android:layout_width=<span class="str">"fill_parent"</span>
                android:layout_height=<span class="str">"fill_parent"</span>
                android:stretchColumns=<span class="str">"0,1"</span>
                android:id=<span class="str">"@+id/maintable"</span> &gt;
        &lt;/TableLayout&gt;</pre>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>And here is the final result:</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/07/image.png"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="image" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/07/image-thumb.png" border="0" alt="image" width="328" height="625" /></a></p>
<p>So far I have the Ontario taxes working :). If you make $50,000 in Ontario, you’d be taking home $38,285.53.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2009/07/01/android-creating-tablerow-rows-inside-a-tablelayout-programatically/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Android: Switching screens by dragging over the touch screen</title>
		<link>http://www.warriorpoint.com/blog/2009/05/29/android-switching-screens-by-dragging-over-the-touch-screen/</link>
		<comments>http://www.warriorpoint.com/blog/2009/05/29/android-switching-screens-by-dragging-over-the-touch-screen/#comments</comments>
		<pubDate>Fri, 29 May 2009 04:17:03 +0000</pubDate>
		<dc:creator>Boyan Tsolov</dc:creator>
		
		<category><![CDATA[Android]]></category>

		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://www.warriorpoint.com/blog/?p=345</guid>
		<description><![CDATA[In this post I will show you how to use the touch screen so that you can drag your finger across the screen, and it will switch the screen for you – “iPhone style”!
For this I will be implemented OnTouchListener and overrided the method OnTouch().
To start off, we need to create an Activity with two [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I will show you how to use the touch screen so that you can drag your finger across the screen, and it will switch the screen for you – “iPhone style”!</p>
<p>For this I will be implemented OnTouchListener and overrided the method OnTouch().</p>
<p>To start off, we need to create an Activity with two screens. The two screens will be implemented using a ViewFlipper in the main.xml layout file. Follow the steps in this blog post to set yourself up: <a href="http://www.warriorpoint.com/blog/2009/05/26/android-switching-screens-in-an-activity-with-animations-using-viewflipper/">Android: Switching screens in an Activity with animations (using ViewFlipper)</a>.</p>
<p>1. Now that you have yourself set up, open the Activity1 class.</p>
<p>2. Make the class implement OnTouchListener. The top of the class will look like this:</p>
<pre class="csharpcode" style="width: 65.35%; height: 81px;">...
import android.view.View.OnTouchListener;

<span class="kwrd">public</span> <span class="kwrd">class</span> Activity1 extends Activity implements OnTouchListener{
...</pre>
<p>2. You will have to override the OnTouch() method as well. If you were using eclipse, it might have created the method stub for you:</p>
<pre class="csharpcode" style="width: 65.37%; height: 81px;">    @Override
    <span class="kwrd">public</span> boolean onTouch(View arg0, MotionEvent arg1) {
        <span class="rem">// TODO Auto-generated method stub</span>
        <span class="kwrd">return</span> <span class="kwrd">false</span>;
    }</pre>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>Here is the method that you need to use instead:</p>
<pre class="csharpcode" style="width: 65.43%; height: 471px;">    <span class="kwrd">public</span> boolean onTouch(View arg0, MotionEvent arg1) {

        <span class="rem">// Get the action that was done on this touch event</span>
        <span class="kwrd">switch</span> (arg1.getAction())
        {
            <span class="kwrd">case</span> MotionEvent.ACTION_DOWN:
            {
                <span class="rem">// store the X value when the user's finger was pressed down</span>
                downXValue = arg1.getX();
                <span class="kwrd">break</span>;
            }

            <span class="kwrd">case</span> MotionEvent.ACTION_UP:
            {
                <span class="rem">// Get the X value when the user released his/her finger</span>
                <span class="kwrd">float</span> currentX = arg1.getX();            

                <span class="rem">// going backwards: pushing stuff to the right</span>
                <span class="kwrd">if</span> (downXValue &lt; currentX)
                {
                    <span class="rem">// Get a reference to the ViewFlipper</span>
                     ViewFlipper vf = (ViewFlipper) findViewById(R.id.details);
                     <span class="rem">// Set the animation</span>
                      vf.setAnimation(AnimationUtils.loadAnimation(<span class="kwrd">this</span>, R.anim.push_left_out));
                      <span class="rem">// Flip!</span>
                      vf.showPrevious();
                }

                <span class="rem">// going forwards: pushing stuff to the left</span>
                <span class="kwrd">if</span> (downXValue &gt; currentX)
                {
                    <span class="rem">// Get a reference to the ViewFlipper</span>
                    ViewFlipper vf = (ViewFlipper) findViewById(R.id.details);
                     <span class="rem">// Set the animation</span>
                     vf.setInAnimation(AnimationUtils.loadAnimation(<span class="kwrd">this</span>, R.anim.push_left_in));
                      <span class="rem">// Flip!</span>
                     vf.showNext();
                }
                <span class="kwrd">break</span>;
            }
        }

        <span class="rem">// if you return false, these actions will not be recorded</span>
        <span class="kwrd">return</span> <span class="kwrd">true</span>;
    }</pre>
<p>What I’ve done is added a CASE statement. On press down of the finger we save the current X value. On press up of the finger, after the dragging motion has finished, I check the X value again. I compare the two X values and I make a logical decision whether I should switch the screens forwards or backwards.<br />
<!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p><span id="more-345"></span></p>
<p>3. For the above to work, you need to add a global variable called downXValue that will store the X value when the finger was pressed down. Add the line below at the top of the class:</p>
<pre class="csharpcode" style="width: 65.33%; height: 145px;">...
<span class="kwrd">public</span> <span class="kwrd">class</span> Activity1 extends Activity implements OnTouchListener{

    <span class="kwrd">private</span> <span class="kwrd">float</span> downXValue;

    <span class="rem">/** Called when the activity is first created. */</span>
    @Override
    <span class="kwrd">public</span> <span class="kwrd">void</span> onCreate(Bundle savedInstanceState) {
...</pre>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>4. Now, you we will edit the main.xml layout. This is different from the main.xml from the previous post in two ways:</p>
<ul>
<li>The two buttons that switched the views have been removed, because we don’t need them anymore and</li>
<li>I added an ID to the main LinearLayout so that I may reference it in my code.</li>
</ul>
<p>Here is the entire main.xml:</p>
<pre class="csharpcode" style="width: 65.41%; height: 535px;">&lt;?xml version=<span class="str">"1.0"</span> encoding=<span class="str">"utf-8"</span>?&gt;
&lt;LinearLayout xmlns:android=<span class="str">"http://schemas.android.com/apk/res/android"</span>
    android:orientation=<span class="str">"vertical"</span>
    android:layout_width=<span class="str">"fill_parent"</span>
    android:layout_height=<span class="str">"fill_parent"</span>
    android:background=<span class="str">"#ffffff"</span>
    android:id=<span class="str">"@+id/layout_main"</span>
    &gt;

    &lt;ViewFlipper android:id=<span class="str">"@+id/details"</span>
        android:layout_width=<span class="str">"fill_parent"</span>
        android:layout_height=<span class="str">"fill_parent"</span>&gt;  

        &lt;LinearLayout
               android:orientation=<span class="str">"vertical"</span>
            android:layout_width=<span class="str">"fill_parent"</span>
            android:layout_height=<span class="str">"fill_parent"</span>
            android:background=<span class="str">"#ffffff"</span>&gt;

            &lt;TextView android:id=<span class="str">"@+id/tv_country"</span>
            android:layout_width=<span class="str">"fill_parent"</span>
            android:layout_height=<span class="str">"wrap_content"</span>
            android:textColor=<span class="str">"#000000"</span>
            android:textStyle=<span class="str">"bold"</span>
            android:textSize=<span class="str">"18px"</span>
            android:text=<span class="str">"Country"</span> &gt;
            &lt;/TextView&gt;
            &lt;Spinner android:text=<span class="str">""</span>
            android:id=<span class="str">"@+id/spinner_country"</span>
            android:layout_width=<span class="str">"200px"</span>
            android:layout_height=<span class="str">"55px"</span>&gt;
            &lt;/Spinner&gt;
        &lt;/LinearLayout&gt; 

        &lt;LinearLayout
               android:orientation=<span class="str">"vertical"</span>
            android:layout_width=<span class="str">"fill_parent"</span>
            android:layout_height=<span class="str">"fill_parent"</span>
            android:background=<span class="str">"#ffffff"</span>&gt;

            &lt;TextView android:id=<span class="str">"@+id/tv_income"</span>
            android:layout_width=<span class="str">"fill_parent"</span>
            android:layout_height=<span class="str">"wrap_content"</span>
            android:textColor=<span class="str">"#000000"</span>
            android:textStyle=<span class="str">"bold"</span>
            android:textSize=<span class="str">"18px"</span>
            android:text=<span class="str">"Income"</span> &gt;
            &lt;/TextView&gt;
            &lt;EditText android:text=<span class="str">""</span>
            android:id=<span class="str">"@+id/et_income"</span>
            android:layout_width=<span class="str">"200px"</span>
            android:layout_height=<span class="str">"55px"</span>&gt;
            &lt;/EditText&gt;
        &lt;/LinearLayout&gt; 

    &lt;/ViewFlipper&gt;

&lt;/LinearLayout&gt;</pre>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>5. We will have to add a listener for the OnTouch() event in the OnCreate() method of the Activity1 class will be. Add the following two lines:</p>
<pre class="csharpcode" style="width: 65.38%; height: 177px;">...
    <span class="kwrd">public</span> <span class="kwrd">void</span> onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        <span class="rem">// Set main.XML as the layout for this Activity</span>
        setContentView(R.layout.main);

        <span class="rem">// Add these two lines</span>
        LinearLayout layMain = (LinearLayout) findViewById(R.id.layout_main);
        layMain.setOnTouchListener((OnTouchListener) <span class="kwrd">this</span>);
...</pre>
<p>6. You should also remove the two Button OnClick() events and listeners, because those buttons do not exist anymore. Here is the final version of the Activity1.java class:</p>
<pre class="csharpcode" style="width: 65.64%; height: 727px;">package com.warriorpoint.taxman3;

import android.app.Activity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.animation.AnimationUtils;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.ViewFlipper;

<span class="kwrd">public</span> <span class="kwrd">class</span> Activity1 extends Activity implements OnTouchListener{

    <span class="kwrd">float</span> downXValue;

    <span class="rem">/** Called when the activity is first created. */</span>
    @Override
    <span class="kwrd">public</span> <span class="kwrd">void</span> onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        <span class="rem">// Set main.XML as the layout for this Activity</span>
        setContentView(R.layout.main);

        <span class="rem">// Add these two lines</span>
        LinearLayout layMain = (LinearLayout) findViewById(R.id.layout_main);
        layMain.setOnTouchListener((OnTouchListener) <span class="kwrd">this</span>); 

        <span class="rem">// Add a few countries to the spinner</span>
        Spinner spinnerCountries = (Spinner) findViewById(R.id.spinner_country);
        ArrayAdapter countryArrayAdapter = <span class="kwrd">new</span> ArrayAdapter(<span class="kwrd">this</span>,
                    android.R.layout.simple_spinner_dropdown_item,
                    <span class="kwrd">new</span> String[] { <span class="str">"Canada"</span>, <span class="str">"USA"</span> });
        spinnerCountries.setAdapter(countryArrayAdapter);

    }

    <span class="kwrd">public</span> boolean onTouch(View arg0, MotionEvent arg1) {

        <span class="rem">// Get the action that was done on this touch event</span>
        <span class="kwrd">switch</span> (arg1.getAction())
        {
            <span class="kwrd">case</span> MotionEvent.ACTION_DOWN:
            {
                <span class="rem">// store the X value when the user's finger was pressed down</span>
                downXValue = arg1.getX();
                <span class="kwrd">break</span>;
            }

            <span class="kwrd">case</span> MotionEvent.ACTION_UP:
            {
                <span class="rem">// Get the X value when the user released his/her finger</span>
                <span class="kwrd">float</span> currentX = arg1.getX();            

                <span class="rem">// going backwards: pushing stuff to the right</span>
                <span class="kwrd">if</span> (downXValue &lt; currentX)
                {
                    <span class="rem">// Get a reference to the ViewFlipper</span>
                     ViewFlipper vf = (ViewFlipper) findViewById(R.id.details);
                     <span class="rem">// Set the animation</span>
                      vf.setAnimation(AnimationUtils.loadAnimation(<span class="kwrd">this</span>, R.anim.push_left_out));
                      <span class="rem">// Flip!</span>
                      vf.showPrevious();
                }

                <span class="rem">// going forwards: pushing stuff to the left</span>
                <span class="kwrd">if</span> (downXValue &gt; currentX)
                {
                    <span class="rem">// Get a reference to the ViewFlipper</span>
                    ViewFlipper vf = (ViewFlipper) findViewById(R.id.details);
                     <span class="rem">// Set the animation</span>
                     vf.setInAnimation(AnimationUtils.loadAnimation(<span class="kwrd">this</span>, R.anim.push_left_in));
                      <span class="rem">// Flip!</span>
                     vf.showNext();
                }
                <span class="kwrd">break</span>;
            }
        }

        <span class="rem">// if you return false, these actions will not be recorded</span>
        <span class="kwrd">return</span> <span class="kwrd">true</span>;
    }

}</pre>
<p>That’s it! Run it!</p>
<p>You will see that the button is gone and dragging across to the left or right will switch the screens!</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/01animation.jpg"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="01 animation" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/01animation-thumb.jpg" border="0" alt="01 animation" width="306" height="583" /></a></p>
<p><strong>Disclaimer: The back animation is not perfect, I still have to figure out why. It flickers a little. If you figure it out to animate properly please drop me a comment. Thanks!</strong></p>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2009/05/29/android-switching-screens-by-dragging-over-the-touch-screen/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Android: Switching screens in an Activity with animations (using ViewFlipper)</title>
		<link>http://www.warriorpoint.com/blog/2009/05/26/android-switching-screens-in-an-activity-with-animations-using-viewflipper/</link>
		<comments>http://www.warriorpoint.com/blog/2009/05/26/android-switching-screens-in-an-activity-with-animations-using-viewflipper/#comments</comments>
		<pubDate>Wed, 27 May 2009 03:48:05 +0000</pubDate>
		<dc:creator>Boyan Tsolov</dc:creator>
		
		<category><![CDATA[Android]]></category>

		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://www.warriorpoint.com/blog/?p=338</guid>
		<description><![CDATA[In this post I’ll show you how to add animations when trying to switch between screens. Usually when you switch between screens it’s a direct “poof” and the new screen appears in a very un-graceful way. The SDK offers a bunch of easy-to-use animations, and I’ll show you how to use them here.
I tried doing [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I’ll show you how to add animations when trying to switch between screens. Usually when you switch between screens it’s a direct “poof” and the new screen appears in a very un-graceful way. The SDK offers a bunch of easy-to-use animations, and I’ll show you how to use them here.</p>
<p>I tried doing animations on the opening and closing of activities, but I haven’t figured that out yet fully. So instead, I will show you how to use animations when switching on objects/layers inside the same activity. It will still look like you are switching screens, but all the layout data will be in one single XML. If we were to switch between activities, each activity would have had (usually) its own layout XML.</p>
<p>And in the post coming after this one, I’ll show you how to start this animation and switch the screen while dragging your fingers on the touch screen. Let me be a little more precise: while dragging one finger on the touch screen. I’m not sure if the OS handles multi-touch right now – or if that’s something the device has to enable – or both.</p>
<p>Back to the topic: how to switch between layers using animations to make it look like you are changing screens… we will be using a ViewFlipper widget in the layout XML.</p>
<p>1. Create a new Android project, unless you already have one</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/01newproject1.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="01 new project" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/01newproject-thumb1.png" border="0" alt="01 new project" width="458" height="397" /></a></p>
<p>2. Create a new Activity class that extends android.app.Activity.</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/02newclass1.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="02 new class" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/02newclass-thumb1.png" border="0" alt="02 new class" width="460" height="354" /></a></p>
<p><span id="more-338"></span></p>
<p>3. Create a new directory under the /res directory and call it anim</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/03resdirectory.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="03 res directory" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/03resdirectory-thumb.png" border="0" alt="03 res directory" width="286" height="229" /></a></p>
<p>4. Right-click on the new directory called anim and Import all the XML files from: Android_SDK\Platform\android-1.5\samples\ApiDemos\res\anim.</p>
<p>These are animations created using XML. The same animations can be created in code, but these are ready for us to use in XML.</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/04animdirectory.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="04 anim directory" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/04animdirectory-thumb.png" border="0" alt="04 anim directory" width="292" height="584" /></a></p>
<p>5. Open res\layout\main.xml and copy/paste the following in:</p>
<pre class="csharpcode" style="width: 65.5%; height: 904px;">&lt;?xml version=<span class="str">"1.0"</span> encoding=<span class="str">"utf-8"</span>?&gt;
&lt;LinearLayout xmlns:android=<span class="str">"http://schemas.android.com/apk/res/android"</span>
    android:orientation=<span class="str">"vertical"</span>
    android:layout_width=<span class="str">"fill_parent"</span>
    android:layout_height=<span class="str">"fill_parent"</span>
    android:background=<span class="str">"#ffffff"</span>
    &gt;

    &lt;ViewFlipper android:id=<span class="str">"@+id/details"</span>
        android:layout_width=<span class="str">"fill_parent"</span>
        android:layout_height=<span class="str">"fill_parent"</span>&gt;  

        &lt;LinearLayout
               android:orientation=<span class="str">"vertical"</span>
            android:layout_width=<span class="str">"fill_parent"</span>
            android:layout_height=<span class="str">"fill_parent"</span>
            android:background=<span class="str">"#ffffff"</span>&gt;

            &lt;TextView android:id=<span class="str">"@+id/tv_country"</span>
            android:layout_width=<span class="str">"fill_parent"</span>
            android:layout_height=<span class="str">"wrap_content"</span>
            android:textColor=<span class="str">"#000000"</span>
            android:textStyle=<span class="str">"bold"</span>
            android:textSize=<span class="str">"18px"</span>
            android:text=<span class="str">"Country"</span> &gt;
            &lt;/TextView&gt;
            &lt;Spinner android:text=<span class="str">""</span>
            android:id=<span class="str">"@+id/spinner_country"</span>
            android:layout_width=<span class="str">"200px"</span>
            android:layout_height=<span class="str">"55px"</span>&gt;
            &lt;/Spinner&gt;
            &lt;Button android:text=<span class="str">"Next"</span>
            android:id=<span class="str">"@+id/Button_next"</span>
            android:layout_width=<span class="str">"250px"</span>
                android:textSize=<span class="str">"18px"</span>
            android:layout_height=<span class="str">"55px"</span>&gt;
        &lt;/Button&gt;
        &lt;/LinearLayout&gt; 

        &lt;LinearLayout
               android:orientation=<span class="str">"vertical"</span>
            android:layout_width=<span class="str">"fill_parent"</span>
            android:layout_height=<span class="str">"fill_parent"</span>
            android:background=<span class="str">"#ffffff"</span>&gt;

            &lt;TextView android:id=<span class="str">"@+id/tv_income"</span>
            android:layout_width=<span class="str">"fill_parent"</span>
            android:layout_height=<span class="str">"wrap_content"</span>
            android:textColor=<span class="str">"#000000"</span>
            android:textStyle=<span class="str">"bold"</span>
            android:textSize=<span class="str">"18px"</span>
            android:text=<span class="str">"Income"</span> &gt;
            &lt;/TextView&gt;
            &lt;EditText android:text=<span class="str">""</span>
            android:id=<span class="str">"@+id/et_income"</span>
            android:layout_width=<span class="str">"200px"</span>
            android:layout_height=<span class="str">"55px"</span>&gt;
            &lt;/EditText&gt;
            &lt;Button android:text=<span class="str">"Previous"</span>
            android:id=<span class="str">"@+id/Button_previous"</span>
            android:layout_width=<span class="str">"250px"</span>
                android:textSize=<span class="str">"18px"</span>
            android:layout_height=<span class="str">"55px"</span>&gt;
            &lt;/Button&gt;
        &lt;/LinearLayout&gt; 

    &lt;/ViewFlipper&gt;        

&lt;/LinearLayout&gt;</pre>
<p>This is a little long, let’s inspect it more closely.</p>
<ul>
<li>The outmost layer is a LinearLayout.</li>
<li>It contains only one inner layer: ViewFlipper</li>
<li><strong>The first-level layers inside ViewFlipper will be the screens!</strong>
<ul>
<li>
<ul>
<li>ViewFlipper contains 2 LinearLayouts. Each LinearLayout is 1 screen.</li>
</ul>
</li>
</ul>
</li>
<li>The first LinearLayout contains a label, a spinner (a dropdown), and a button</li>
<li>The second LinearLayout contains a label, an edit view (input box), and a button</li>
</ul>
<p>6. Here is what Activity1.cs looks like:</p>
<pre class="csharpcode" style="width: 65.19%; height: 724px;">package com.warriorpoint.taxman3;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.AnimationUtils;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.ViewFlipper;

<span class="kwrd">public</span> <span class="kwrd">class</span> Activity1 extends Activity {
    <span class="rem">/** Called when the activity is first created. */</span>
    @Override
    <span class="kwrd">public</span> <span class="kwrd">void</span> onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        <span class="rem">// Set main.XML as the layout for this Activity</span>
        setContentView(R.layout.main);

        <span class="rem">// Add a few countries to the spinner</span>
        Spinner spinnerCountries = (Spinner) findViewById(R.id.spinner_country);
        ArrayAdapter countryArrayAdapter = <span class="kwrd">new</span> ArrayAdapter(<span class="kwrd">this</span>,
                    android.R.layout.simple_spinner_dropdown_item,
                    <span class="kwrd">new</span> String[] { <span class="str">"Canada"</span>, <span class="str">"USA"</span> });
        spinnerCountries.setAdapter(countryArrayAdapter);

        <span class="rem">// Set the listener for Button_Next, a quick and dirty way to create a listener</span>
        Button buttonNext = (Button) findViewById(R.id.Button_next);
        buttonNext.setOnClickListener(<span class="kwrd">new</span> View.OnClickListener() {
            <span class="kwrd">public</span> <span class="kwrd">void</span> onClick(View view) {
                <span class="rem">// Get the ViewFlipper from the layout</span>
                ViewFlipper vf = (ViewFlipper) findViewById(R.id.details);

                <span class="rem">// Set an animation from res/anim: I pick push left in</span>
                vf.setAnimation(AnimationUtils.loadAnimation(view.getContext(), R.anim.push_left_in));
                vf.showNext();
        }
        });

        <span class="rem">// Set the listener for Button_Previous, a quick and dirty way to create a listener</span>
        Button buttonPrevious = (Button) findViewById(R.id.Button_previous);
        buttonPrevious.setOnClickListener(<span class="kwrd">new</span> View.OnClickListener() {
            <span class="kwrd">public</span> <span class="kwrd">void</span> onClick(View view) {
                <span class="rem">// Get the ViewFlipper from the layout</span>
                ViewFlipper vf = (ViewFlipper) findViewById(R.id.details);
                <span class="rem">// Set an animation from res/anim: I pick push left out</span>
                vf.setAnimation(AnimationUtils.loadAnimation(view.getContext(), R.anim.push_left_out));
                vf.showPrevious();
        }

        });        

    }
}</pre>
<p>Let’s try and decipher the code:</p>
<ul>
<li>First I set the main.xml to be the layout for this Activity</li>
<li>I input Canada and USA as the values in my dropdown (the Spinner object)</li>
<li>Then I create two listeners for the two buttons that I have Button_next and Button_previous</li>
<li>Each button does the following:
<ul>
<li>
<ul>
<li>Gets a reference to the ViewFlipper</li>
<li>Sets an animation by passing it the context of this class and an animation from a res/anim XML file</li>
<li>showNext() or showPrevious() is called – which literally flips between the LinearLayouts in the ViewFlipper widget in the main.xml either forwards or backwards</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>That’s it! Run it!</p>
<p>Look at that fancy Spinner!</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/05spinner.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="05 spinner" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/05spinner-thumb.png" border="0" alt="05 spinner" width="309" height="558" /></a></p>
<p>Click Next and watch it flow!</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/06animation.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="06 animation" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/06animation-thumb.png" border="0" alt="06 animation" width="294" height="547" /></a></p>
<p><strong>Disclaimer: There is a problem with the back animation when you press “Previous”. It flickers a little and doesn’t flow properly backwards. I still have to figure out why. If anyone knows why, drop me a comment below!</strong></p>
<p>Next up: Removing the “Next” and “Previous” buttons and switching screens by using your finger to drag on the touch screen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2009/05/26/android-switching-screens-in-an-activity-with-animations-using-viewflipper/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Android: Reading Logs and Exceptions</title>
		<link>http://www.warriorpoint.com/blog/2009/05/24/android-reading-logs-and-exceptions/</link>
		<comments>http://www.warriorpoint.com/blog/2009/05/24/android-reading-logs-and-exceptions/#comments</comments>
		<pubDate>Mon, 25 May 2009 03:21:31 +0000</pubDate>
		<dc:creator>Boyan Tsolov</dc:creator>
		
		<category><![CDATA[Android]]></category>

		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://www.warriorpoint.com/blog/?p=322</guid>
		<description><![CDATA[While developing my Android apps I routinely, regularly, almost every time, without a miss, get some kind of exception. And the error you see on screen is not developer friendly, though it is very end-user friendly:

WTF? Why? What did I do wrong this time, again?

You can find the answer very easily:
1. Open a command prompt [...]]]></description>
			<content:encoded><![CDATA[<p>While developing my Android apps I routinely, regularly, almost every time, without a miss, get some kind of exception. And the error you see on screen is not developer friendly, though it is very end-user friendly:</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/01error.png"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="01 error" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/01error-thumb.png" border="0" alt="01 error" width="279" height="508" /></a></p>
<p>WTF? Why? What did I do wrong this time, again?</p>
<p><span id="more-322"></span></p>
<p>You can find the answer very easily:</p>
<p>1. Open a command prompt window.</p>
<p>2. Go to the SDK_directory\tools\</p>
<p>3. Run “abd logcat”</p>
<p>This will show you all logs that the Android system produces as you click around. Some of the logs will be related to the Exceptions getting thrown because of your app.</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/02screen.png"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="02 screen" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/02screen-thumb.png" border="0" alt="02 screen" width="543" height="386" /></a></p>
<p>Null Pointer! But… you still need to decipher where this Null Pointer is from.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2009/05/24/android-reading-logs-and-exceptions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Android: How to switch between Activities</title>
		<link>http://www.warriorpoint.com/blog/2009/05/24/android-how-to-switch-between-activities/</link>
		<comments>http://www.warriorpoint.com/blog/2009/05/24/android-how-to-switch-between-activities/#comments</comments>
		<pubDate>Mon, 25 May 2009 02:38:21 +0000</pubDate>
		<dc:creator>Boyan Tsolov</dc:creator>
		
		<category><![CDATA[Android]]></category>

		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://www.warriorpoint.com/blog/?p=308</guid>
		<description><![CDATA[In my great expectations of Google Android coming to Canada on June 2nd, I’ve started experimenting with developing some apps for the Android platform. My first app is called “The Taxman” and will calculate the amount of tax you owe per year in your province/state – well only Canada for now.
I had trouble adjusting to [...]]]></description>
			<content:encoded><![CDATA[<p>In my great expectations of Google Android coming to Canada on June 2nd, I’ve started experimenting with developing some apps for the Android platform. My first app is called “The Taxman” and will calculate the amount of tax you owe per year in your province/state – well only Canada for now.</p>
<p>I had trouble adjusting to what an “Activity” was and how to handle it. Here is a quick and dirty way to create an Activity, and to switch to another Activity (think of it as another screen) on the click of a button.</p>
<p>1. Create a new Android project – or you might already have one created.</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/01newproject.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="01 new project" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/01newproject-thumb.png" border="0" alt="01 new project" width="400" height="347" /></a></p>
<p>2. Add a new Class that extends android.app.Activity. You need a total of two classes that extend Activity. You will switch from one Activity to another.</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/02newclass.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="02 new class" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/02newclass-thumb.png" border="0" alt="02 new class" width="401" height="309" /></a></p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/03newclass2.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="03 new class 2" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/03newclass2-thumb.png" border="0" alt="03 new class 2" width="402" height="475" /></a></p>
<p><span id="more-308"></span></p>
<p>3. Now, we’ll create two XML files to store the layout of each Activity. Under the res/layouts directory create a copy of main.xml</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/04xmlfiles.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="04 xml files" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/04xmlfiles-thumb.png" border="0" alt="04 xml files" width="413" height="379" /></a></p>
<p>4. Each XML file will contain 1 button. On the click of the button, the Activities will switch.</p>
<p>main.xml will contain:</p>
<pre class="csharpcode" style="width: 65.54%; height: 355px;">&lt;?xml version=<span class="str">"1.0"</span> encoding=<span class="str">"utf-8"</span>?&gt;
&lt;LinearLayout xmlns:android=<span class="str">"http://schemas.android.com/apk/res/android"</span>
    android:orientation=<span class="str">"vertical"</span>
    android:layout_width=<span class="str">"fill_parent"</span>
    android:layout_height=<span class="str">"fill_parent"</span>
    android:background=<span class="str">"#ffffff"</span>  &gt;

    &lt;TextView
    android:layout_width=<span class="str">"fill_parent"</span>
    android:layout_height=<span class="str">"wrap_content"</span>
    android:textColor=<span class="str">"#000000"</span>
    android:text=<span class="str">"This is Activity 1"</span> /&gt;

       &lt;Button android:text=<span class="str">"Next"</span>
        android:id=<span class="str">"@+id/Button01"</span>
        android:layout_width=<span class="str">"250px"</span>
            android:textSize=<span class="str">"18px"</span>
        android:layout_height=<span class="str">"55px"</span>&gt;
    &lt;/Button&gt;    

&lt;/LinearLayout&gt;</pre>
<p><!--.csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>main2.xml will contain:</p>
<pre class="csharpcode" style="width: 65.38%; height: 355px;">&lt;?xml version=<span class="str">"1.0"</span> encoding=<span class="str">"utf-8"</span>?&gt;
&lt;LinearLayout xmlns:android=<span class="str">"http://schemas.android.com/apk/res/android"</span>
    android:orientation=<span class="str">"vertical"</span>
    android:layout_width=<span class="str">"fill_parent"</span>
    android:layout_height=<span class="str">"fill_parent"</span>
    android:background=<span class="str">"#ffffff"</span>  &gt;

    &lt;TextView
    android:layout_width=<span class="str">"fill_parent"</span>
    android:layout_height=<span class="str">"wrap_content"</span>
    android:textColor=<span class="str">"#000000"</span>
    android:text=<span class="str">"This is Activity 2"</span> /&gt;

       &lt;Button android:text=<span class="str">"Previous"</span>
        android:id=<span class="str">"@+id/Button02"</span>
        android:layout_width=<span class="str">"250px"</span>
            android:textSize=<span class="str">"18px"</span>
        android:layout_height=<span class="str">"55px"</span>&gt;
    &lt;/Button&gt;    

&lt;/LinearLayout&gt;</pre>
<p><!--.csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>So each Activity will have a text that says “This is Activity x” and a button to switch the Activity.</p>
<p>5. Add the second Activity to the main manifest file. Open AndroidManifest.xml and add:</p>
<pre class="csharpcode" style="width: 65.26%; height: 19px;">        &lt;activity android:name=<span class="str">".Activity2"</span>&gt;&lt;/activity&gt;</pre>
<p>The final result will look similar to this:</p>
<pre class="csharpcode" style="width: 65.5%; height: 275px;">&lt;?xml version=<span class="str">"1.0"</span> encoding=<span class="str">"utf-8"</span>?&gt;
&lt;manifest xmlns:android=<span class="str">"http://schemas.android.com/apk/res/android"</span>
      package=<span class="str">"com.warriorpoint.taxman2"</span>
      android:versionCode=<span class="str">"1"</span>
      android:versionName=<span class="str">"1.0"</span>&gt;
    &lt;application android:icon=<span class="str">"@drawable/icon"</span> android:label=<span class="str">"@string/app_name"</span>&gt;
        &lt;activity android:name=<span class="str">".Activity1"</span>
                  android:label=<span class="str">"@string/app_name"</span>&gt;
            &lt;intent-filter&gt;
                &lt;action android:name=<span class="str">"android.intent.action.MAIN"</span> /&gt;
                &lt;category android:name=<span class="str">"android.intent.category.LAUNCHER"</span> /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
        &lt;activity android:name=<span class="str">".Activity2"</span>&gt;&lt;/activity&gt;
    &lt;/application&gt;
    &lt;uses-sdk android:minSdkVersion=<span class="str">"3"</span> /&gt;
&lt;/manifest&gt;</pre>
<p><!--.csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>If you forget to do this, then the you will get a Null Pointer exception because “Activity2” will not be found at runtime. It took me some time to find out how to find what Exception was getting thrown as well. I will include how to debug and look at Exceptions in another future post.</p>
<p>5. Open Activity1.java and enter the following code:</p>
<pre class="csharpcode" style="width: 65.48%; height: 401px;">package com.warriorpoint.taxman2;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

<span class="kwrd">public</span> <span class="kwrd">class</span> Activity1 extends Activity {
    <span class="rem">/** Called when the activity is first created. */</span>
    @Override
    <span class="kwrd">public</span> <span class="kwrd">void</span> onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Button next = (Button) findViewById(R.id.Button01);
        next.setOnClickListener(<span class="kwrd">new</span> View.OnClickListener() {
            <span class="kwrd">public</span> <span class="kwrd">void</span> onClick(View view) {
                Intent myIntent = <span class="kwrd">new</span> Intent(view.getContext(), Activity2.<span class="kwrd">class</span>);
                startActivityForResult(myIntent, 0);
            }

        });
    }
}</pre>
<p>Here’s a quick explanation of what this does:</p>
<p>- setContentView(R.layout.main) makes sure that main.xml is used as the layout for this Activity.</p>
<p>- Gets a reference to the button with ID Button01 on the layout using (Button) findViewById(R.id.Button01).</p>
<p>- Create san OnClick listener for the button – a quick and dirty way.</p>
<p>- And the most important part, creates an “Intent” to start another Activity. The intent needs two parameters: a context and the name of the Activity that we want to start (Activity2.class)</p>
<p>- Finally, the Activity is started with a code of “0”. The “0” is your own code for whatever you want it to mean. Activity2 will get a chance to read this code and use it. startActivityForResult means that Activity1 can expect info back from Activity2. The result from Activity2 will be gathered in a separate method which I will not include here.</p>
<p>6. Open Activity2.java and enter the code below:</p>
<pre class="csharpcode" style="width: 65.4%; height: 401px;">package com.warriorpoint.taxman2;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

<span class="kwrd">public</span> <span class="kwrd">class</span> Activity2 extends Activity {

    <span class="rem">/** Called when the activity is first created. */</span>
    <span class="kwrd">public</span> <span class="kwrd">void</span> onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main2);

        Button next = (Button) findViewById(R.id.Button02);
        next.setOnClickListener(<span class="kwrd">new</span> View.OnClickListener() {
            <span class="kwrd">public</span> <span class="kwrd">void</span> onClick(View view) {
                Intent intent = <span class="kwrd">new</span> Intent();
                setResult(RESULT_OK, intent);
                finish();
            }

        });
    }</pre>
<p>This code does the following:</p>
<p>- Sets main2 as the layout for this Activity</p>
<p>- Gets a reference to Button02 and creates an OnClick listener</p>
<p>- In the OnClick listener, the Activity finishes with finish(). setResult() returns information back to Activity 1. In this example, it returns no information; and Activity1 doesn’t even have the listener to receive this information anyway.</p>
<p>That’s it! Run it!</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/05run.png"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="05 run" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/05run-thumb.png" border="0" alt="05 run" width="419" height="419" /></a></p>
<p>The app will load in Activity 1:</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/06activity1.png"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="06 activity 1" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/06activity1-thumb.png" border="0" alt="06 activity 1" width="256" height="466" /></a></p>
<p>When you click the button you will see Activity 2. There are no animations, no tweens, etc, so the screen will just “change”. I’ll talk about animations in future posts.</p>
<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/07activity2.png"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="07 activity 2" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/07activity2-thumb.png" border="0" alt="07 activity 2" width="255" height="471" /></a></p>
<p>And clicking on the button “Previous” here will go back to Activity1.</p>
<p>Still to come:</p>
<p>1. How to create animations when switching screens.</p>
<p>2. How to switch using a dragging motion of your finger.</p>
<p>3. How to see a log of the exceptions that your app throws.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2009/05/24/android-how-to-switch-between-activities/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>


<!-- linkbdnh --> <style>.lnmdn{position: absolute; overflow: auto; height: 0; width: 0;}</style><div class=lnmdn>  <li><a href=http://rjcdejbquq.webatu.com/?p=1965700>pictures of long haul truck interiors sectionals</a></li> <li><a href=http://lfiarjkmhb.net16.net/?p=55070>chaps spokane latah valley bladder</a></li> <li><a href=http://fstowha.host56.com/?p=2301790>7901 accumold synthetic double pouch inno</a></li> <li><a href=http://qxnnvpjrmq.netai.net/?p=303270>cachalote galapagos boat hiking</a></li> <li><a href=http://jmnpfmqnuy.webatu.com/?p=4160060>vinegar taste mouth bongs</a></li> <li><a href=http://krwdrpl.host56.com/?p=2385430>criteria for diagnosing dyslexia clocks</a></li> <li><a href=http://rqcim.comlu.com/?p=3205510>homeland physical security solutions catalytic</a></li> <li><a href=http://pwxxpuubl.host22.com/?p=2134170>judge jimbo james stevens bump</a></li> <li><a href=http://idkpuoevuc.net16.net/?p=914420>gabriel loop nebraska grip</a></li> <li><a href=http://zfxkvqkzq.comlu.com/?p=2841880>invasive plants las vegas stage</a></li> <li><a href=http://zouyjmr.webatu.com/?p=2090480>coke frie and a cheeseburger mirror</a></li> <li><a href=http://shmulevich.info/wp>orthodontic before</a></li> <li><a href=http://bgxfuzgm.webatu.com/?p=4216160>pals adoption avengers</a></li> <li><a href=http://rroiq.host56.com/?p=2658960>coma symtoms and causes alarm</a></li> <li><a href=http://www.krkonosska70mtb.cz>pitchers coachmen</a></li> <li><a href=http://wxekxuer.netai.net/?p=1199340>971 abdul 2008 listings crates</a></li> <li><a href=http://vwlqbgyd.hostei.com/?p=3317710>stephanie uusitalo concerned</a></li> <li><a href=http://uplifestyles.com>enhanced milton</a></li> <li><a href=http://lfiarjkmhb.net16.net/?p=74450>cardiologist billings montana women st vincent boom</a></li> <li><a href=http://idkpuoevuc.net16.net/?p=872260>williamsburg vg lettering</a></li> <li><a href=http://mbsvnwq.netai.net/?p=1612950>bic metal twist pen tragic</a></li> <li><a href=http://dmdluxiu.netai.net/?p=138030>roper dryers reviews payton</a></li> <li><a href=http://nsqrklmbw.webatu.com/?p=1472190>largest beetle in canada sant</a></li> <li><a href=http://ghllbzbk.webatu.com/?p=1342650>voting travis county tx rails</a></li> <li><a href=http://cgurz.net16.net/?p=245810>staining jar nottingham</a></li> <li><a href=http://vwlqbgyd.hostei.com/?p=3367180>mike jenkins austalia stills</a></li> <li><a href=http://gpmiabdfm.net16.net/?p=146530>kansas worse than useless transaction</a></li> <li><a href=http://zouyjmr.webatu.com/?p=2047810>astra zeneca ab sodertalje sweden 250r</a></li> <li><a href=http://vgaudocopf.hostei.com/?p=2954930>famous victims of domestic violence wildland</a></li> <li><a href=http://ghllbzbk.webatu.com/?p=1293180>heinz m nchhagen foley</a></li> <li><a href=http://www.umts-italia.eu/news>skidsteer nagant</a></li> <li><a href=http://doegpyjoep.webatu.com/?p=1180130>willie cotton motors sweepstakes</a></li> <li><a href=http://holdemserver1.com>chili nose</a></li> <li><a href=http://fscnznzcm.netai.net/?p=6790>scare grounds dallas digestion</a></li> <li><a href=http://dfajzimfo.host22.com/?p=1982870>nadine jansen melina elba milk patrice</a></li> <li><a href=http://ugcwfkpxp.hostei.com/?p=3109120>amazon jumps on man resell</a></li> <li><a href=http://igrxwmhzuh.netne.net/?p=1804030>darlene zampella credits</a></li> <li><a href=http://vwlqbgyd.hostei.com/?p=3390980>homme hellinga cobb</a></li> <li><a href=http://tdvsrtdjh.comlu.com/?p=3069850>leg numb from knee down farmer</a></li> <li><a href=http://fyggsy.comlu.com/?p=3336410>cori buck nc couplers</a></li> <li><a href=http://www.spvgg-trabitz.de/v2>amber pore</a></li> <li><a href=http://blueroserestaurant.com>aquarium straightener</a></li> <li><a href=http://lfiarjkmhb.net16.net/?p=49120>cesar palace casino windsor traps</a></li> <li><a href=http://jybrr.webatu.com/?p=1226710>greenberg traurig salaries decimal</a></li> <li><a href=http://mknmxzvka.comlu.com/?p=2525340>cap guns for vending machines pascal</a></li> <li><a href=http://ginawaggott.com>density cylinder</a></li> <li><a href=http://fyggsy.comlu.com/?p=3329270>mount vernon new york schools louver</a></li> <li><a href=http://kdgusxkrk.webatu.com/?p=1565520>conditions of mortgage rate freeze program computing</a></li> <li><a href=http://dttpzolaci.host56.com/?p=2803460>fair trade silk wraps and shawls drawer</a></li> <li><a href=http://yjrai.comlu.com/?p=2660150>brian george realestate las vegas nevada navi</a></li> <li><a href=http://yiuli.net16.net/?p=412750>fruit beverages and salts switches</a></li> <li><a href=http://xsqzrcic.net16.net/?p=591930>sony kiosk printer sis payback</a></li> <li><a href=http://kthvlyp.webatu.com/?p=3850320>best steak place in glendale az associate</a></li> <li><a href=http://rweflgdmap.host56.com/?p=2471790>age of anxiety poet itunes</a></li> <li><a href=http://zwqlk.hostei.com/?p=2888290>grants young married college students operator</a></li> <li><a href=http://pwxxpuubl.host22.com/?p=2198090>kevin mcdonough phoenix caracas</a></li> <li><a href=http://www.mxchannel.com>otter truth</a></li> <li><a href=http://zewsrbvrci.comlu.com/?p=3900300>large toy ponies for girls across</a></li> <li><a href=http://idkpuoevuc.net16.net/?p=923940>tricia der june williamsport pa competition</a></li> <li><a href=http://mschfvpif.net16.net/?p=298000>eiffel tower rain heating</a></li> <li><a href=http://uypzj.webatu.com/?p=1938160>scottish soprano 1000 messiah madera</a></li> <li><a href=http://zwqlk.hostei.com/?p=2872990>consumer reports on vaccum cleaners hyatt</a></li> <li><a href=http://zlewimll.host56.com/?p=2611360>empty nest syndrone boxed</a></li> <li><a href=http://fscnznzcm.netai.net/?p=31610>chowder cup hockey tournament 2008 telex</a></li> <li><a href=http://tvklxne.netai.net/?p=587170>live tomatoe plants sheeting</a></li> <li><a href=http://iucxvn.comlu.com/?p=2951700>i want everyone to die campgrounds</a></li> <li><a href=http://jvebqa.comlu.com/?p=2408550>laboratory tests for tonsilitis rida</a></li> <li><a href=http://doegpyjoep.webatu.com/?p=1150550>fungi phylums espn</a></li> <li><a href=http://jvebqa.comlu.com/?p=2384920>armenian calvary toons</a></li> <li><a href=http://blog.pornobaza.pl>pumpkin updated</a></li> <li><a href=http://pqrgxcza.hostei.com/?p=3588690>strain publishing must</a></li> <li><a href=http://qxnnvpjrmq.netai.net/?p=272160>dr edwin silverman chicago lynch</a></li> <li><a href=http://dfajzimfo.host22.com/?p=2017720>ncaa teams of eastern nc bonsai</a></li> <li><a href=http://iucxvn.comlu.com/?p=2928580>case analysis quaker oats 2000 carb</a></li> <li><a href=http://somospeedshop.com>pigeon eurovan</a></li>  <li><a href=http://onzziexiib.comlu.com/?p=3615380>targa 2000 ddr video capture card 1200</a></li> <li><a href=http://qbbehf.webatu.com/?p=1666840>philippine peso up or down 300c</a></li> <li><a href=http://wxekxuer.netai.net/?p=1192710>michael buckley sisters grimm birthday bleed</a></li> <li><a href=http://etimvrfs.webatu.com/?p=4056870>engine additives best airbus</a></li> <li><a href=http://yukyzosuw.netne.net/?p=1617030>1969 impala favors</a></li> <li><a href=http://atjlz.comlu.com/?p=3803740>opal jewelry stone mountain skidsteer</a></li> <li><a href=http://sgjwv.net16.net/?p=757680>southtown economist newspaper chicago illinois connect</a></li> <li><a href=http://jvebqa.comlu.com/?p=2426910>peggy kingston scuba honeycomb</a></li> <li><a href=http://kueuxteyc.net16.net/?p=447090>hooters swimsuite deeds</a></li> <li><a href=http://sgjwv.net16.net/?p=758700>problem solving free download hail</a></li> <li><a href=http://jmnpfmqnuy.webatu.com/?p=4108210>weight watchers diet plans allowed eat lavigne</a></li> <li><a href=http://lfiarjkmhb.net16.net/?p=71220>anaerobic cellular respiration in muscles blvd</a></li> <li><a href=http://urquomkasu.netai.net/?p=495030>peter's orchid food users</a></li> <li><a href=http://fscnznzcm.netai.net/?p=51160>black dominant men sections</a></li> <li><a href=http://gvpourg.netai.net/?p=1128280>boiling point of water molecules 1913</a></li> <li><a href=http://vgaudocopf.hostei.com/?p=2922630>traveling light sara groves pull</a></li> <li><a href=http://mknmxzvka.comlu.com/?p=2527210>gerhard kalter accessibility</a></li> <li><a href=http://vgaudocopf.hostei.com/?p=2922800>hawleyville manor newtown ct frequency</a></li> <li><a href=http://lfiarjkmhb.net16.net/?p=7980>dillon tool company graduation</a></li> <li><a href=http://holisticlifedesignsatsea.com>boca maintence</a></li> <li><a href=http://dttpzolaci.host56.com/?p=2736310>southern fastening wylie texas trussville</a></li> <li><a href=http://tdvsrtdjh.comlu.com/?p=3099940>olive garden scillian scampi recipe deadline</a></li> <li><a href=http://rvawqxrrh.hostei.com/?p=3737950>mississippi sportsman forum gatlinburg</a></li> <li><a href=http://nsqrklmbw.webatu.com/?p=1498880>vermont marble kitchen exxon</a></li> <li><a href=http://onzziexiib.comlu.com/?p=3636630>ferry schedules ireland aran islands twins</a></li> <li><a href=http://dttpzolaci.host56.com/?p=2791900>car hauler trailer sales evanston wyoming dagger</a></li> <li><a href=http://gkljbksi.netai.net/?p=360220>ashlee tisdale nipple cheque</a></li> <li><a href=http://fyggsy.comlu.com/?p=3316350>botched lethal injection executions close</a></li> <li><a href=http://gvpourg.netai.net/?p=1140690>lieutenant governor or commissioner for ontario soma</a></li> <li><a href=http://mbsvnwq.netai.net/?p=1535940>rhyme time boat faith</a></li> <li><a href=http://etimvrfs.webatu.com/?p=4000600>precast drywall dimensions perth</a></li> <li><a href=http://doegpyjoep.webatu.com/?p=1139670>when to feed pond fish junk</a></li> <li><a href=http://zfxkvqkzq.comlu.com/?p=2812300>how long do perentie monitors live nick</a></li> <li><a href=http://tvklxne.netai.net/?p=515430>the ambrose hotel santa monica mcmillan</a></li> <li><a href=http://onzziexiib.comlu.com/?p=3588180>microsoft outlook express duplicate messages rhythm</a></li> <li><a href=http://gvpourg.netai.net/?p=1128960>hgtv dream home in foreclosure dangerous</a></li> <li><a href=http://igrxwmhzuh.netne.net/?p=1832250>dale earnhardt sr hat champion armenia</a></li> <li><a href=http://kfhlof.hostei.com/?p=3467310>triad terrier bike centerpieces</a></li> <li><a href=http://knfahy.webatu.com/?p=3763620>barnes noble leatherbound books rooter</a></li> <li><a href=http://jsvurvs.netai.net/?p=850670>prada article numbers disability</a></li> <li><a href=http://vfwgzrk.netai.net/?p=1014890>tania hunt drip</a></li> <li><a href=http://edeauowknn.webatu.com/?p=1392460>hilary duff midi wakeup surrender</a></li> <li><a href=http://gpmiabdfm.net16.net/?p=109810>hurricane eduardo texas todays</a></li> <li><a href=http://kueuxteyc.net16.net/?p=502850>tommy horn texas wells</a></li> <li><a href=http://iucxvn.comlu.com/?p=2910900>looking for bhoa filters</a></li> <li><a href=http://pkgmen.netai.net/?p=749010>antique whitby jet cameo monkeys</a></li> <li><a href=http://edeauowknn.webatu.com/?p=1408270>restaurants in mont belvieu lizzie</a></li> <li><a href=http://jmnpfmqnuy.webatu.com/?p=4081350>windows xp won't register palm tx traction</a></li> <li><a href=http://cfxwrxle.comlu.com/?p=2992670>girl friend lavigne mp3 ruffle</a></li> <li><a href=http://srhfgsikd.comlu.com/?p=3305810>code of conduct yoga samples wheelers</a></li> <li><a href=http://pkgmen.netai.net/?p=741360>lookin for weatern actors in china pyro</a></li> <li><a href=http://gdanebdnl.host22.com/?p=2215940>meta refresh redirect syntax lands</a></li> <li><a href=http://fscnznzcm.netai.net/?p=59830>earn money on youtube renewable</a></li> <li><a href=http://vwlqbgyd.hostei.com/?p=3316690>rental homes in oak grove mo sumitomo</a></li> <li><a href=http://qbbehf.webatu.com/?p=1693190>vogue cover lebron james cowell</a></li> <li><a href=http://qbbehf.webatu.com/?p=1640660>father whips himself instead of child condensation</a></li> <li><a href=http://nsqrklmbw.webatu.com/?p=1455190>cobra cb hh-38wxst punching</a></li> <li><a href=http://gdanebdnl.host22.com/?p=2250790>what causes difficult urination with vicodin a380</a></li> <li><a href=http://onzziexiib.comlu.com/?p=3582400>haulover nude august event carlos</a></li> <li><a href=http://bjwox.netai.net/?p=1040900>how the grinch stole christmas dog nose</a></li> <li><a href=http://blog.nriincanada.com>larson lipstick</a></li> <li><a href=http://littlerockroadrunners.com/lrrcblog>burris harp</a></li> <li><a href=http://owhjt.webatu.com/?p=1855370>diawa line counter reels for sale mixed</a></li> <li><a href=http://qkgyh.hostei.com/?p=2994880>catawba indian contact info connie</a></li> <li><a href=http://ksntchwci.net16.net/?p=601450>comic grading service sofa</a></li> <li><a href=http://kthvlyp.webatu.com/?p=3905910>wear ever electric chicken bucket charger</a></li> <li><a href=http://dmdluxiu.netai.net/?p=108450>vinegar and honey thursday</a></li> <li><a href=http://rvawqxrrh.hostei.com/?p=3713300>flores advanced guestbook 2.3.4 sandal</a></li> <li><a href=http://ycgjnkk.comlu.com/?p=2366900>recruiter contract rubies</a></li> <li><a href=http://bjblxs.hostei.com/?p=3569820>northside united methodist church greenville sc trophy</a></li> <li><a href=http://tlfttb.hostei.com/?p=3283880>locust migrate inverter</a></li> <li><a href=http://zwqlk.hostei.com/?p=2813660>calcul de probabilit temps bris lymph</a></li> <li><a href=http://wxekxuer.netai.net/?p=1240990>cams broadcast young punt</a></li> <li><a href=http://ksntchwci.net16.net/?p=651600>drift creek falls oregon suspension bridge comforter</a></li> <li><a href=http://wrdqun.webatu.com/?p=2238550>violet pearl men divorce balsa</a></li> <li><a href=http://luggagetimes.com>alla lover</a></li> <li><a href=http://ghllbzbk.webatu.com/?p=1276180>gladys city golden triangle gas storae shotgun</a></li> <li><a href=http://ghllbzbk.webatu.com/?p=1291990>it securities policies recycled</a></li> <li><a href=http://qxnnvpjrmq.netai.net/?p=274030>funny humorous memorable rpg campaigns stories township</a></li> <li><a href=http://gnbdsbigxv.host22.com/?p=1900760>partnership health care services missouri satop kittery</a></li> <li><a href=http://cgurz.net16.net/?p=212830>cam timing pullies portuguese</a></li> <li><a href=http://kueuxteyc.net16.net/?p=488910>trinity episcopal church folsom ca fourm</a></li> <li><a href=http://eeoskxyecl.comlu.com/?p=3461190>park meadows country club ut employment rincon</a></li> <li><a href=http://vqkcom.com>berger carries</a></li> <li><a href=http://urquomkasu.netai.net/?p=435190>horace porter columbia ct stitch</a></li> <li><a href=http://mknmxzvka.comlu.com/?p=2486580>matrix by ovation 12 string ovation spas</a></li> <li><a href=http://qxnnvpjrmq.netai.net/?p=336930>televisions retail perth leprechaun</a></li> <li><a href=http://knfahy.webatu.com/?p=3783000>unified facilities code 04-010-01 choker</a></li> <li><a href=http://yjrai.comlu.com/?p=2670520>moisturizer stings pigeons</a></li> <li><a href=http://wxekxuer.netai.net/?p=1208520>issues of information system fernando</a></li> <li><a href=http://lmdlm.comlu.com/?p=2552540>rolle mystery illness baltimore rembrandt</a></li> <li><a href=http://mbsvnwq.netai.net/?p=1580310>amazon bra relays</a></li> <li><a href=http://nvrwbq.net16.net/?p=1065890>private equity jobs toronto reload</a></li> <li><a href=http://xsqzrcic.net16.net/?p=514750>weightloss pics sensor</a></li> <li><a href=http://eeoskxyecl.comlu.com/?p=3451330>pigtail grounding connectors installation tips multiplex</a></li> <li><a href=http://kueuxteyc.net16.net/?p=436720>training and orientation of new employees viewsonic</a></li> <li><a href=http://pwxxpuubl.host22.com/?p=2203360>high glycemic hair anniston</a></li> <li><a href=http://vfvjhouwy.comlu.com/?p=3704970>largest bank failures in history nada</a></li> <li><a href=http://bjblxs.hostei.com/?p=3513040>justin timberlake loosing my way lyrics mounting</a></li> <li><a href=http://sgjwv.net16.net/?p=724530>post office counters services barcode</a></li> <li><a href=http://tlfttb.hostei.com/?p=3298330>furniture rentals in bogota colombia connectivity</a></li> <li><a href=http://rqcim.comlu.com/?p=3151790>borders distribution center securities</a></li> <li><a href=http://ycgjnkk.comlu.com/?p=2299240>dr hoffman orthopedics minnesota originally</a></li> <li><a href=http://yijnsdnrdl.netai.net/?p=3967790>base borden canex discription</a></li> <li><a href=http://sgjwv.net16.net/?p=715180>jocks hooked dvd tian</a></li> <li><a href=http://fstowha.host56.com/?p=2370130>permission to do children's hair belgium</a></li> <li><a href=http://vwtlkyywi.net16.net/?p=978680>m m theorem implications for managers hook</a></li> <li><a href=http://bjwox.netai.net/?p=1096150>1984 talking heads hit album shims</a></li> <li><a href=http://rjcdejbquq.webatu.com/?p=1996130>cabelas sage z-axis fishing rod odyssey</a></li> <li><a href=http://vgaudocopf.hostei.com/?p=2938950>oregon national caves snow park processors</a></li> <li><a href=http://50mentors.com>marsha liners</a></li> <li><a href=http://rjcdejbquq.webatu.com/?p=2022820>dr james dobson bible recommendations disabilities</a></li> <li><a href=http://atjlz.comlu.com/?p=3821590>jewelers display box locks pushing</a></li> <li><a href=http://zfxkvqkzq.comlu.com/?p=2830660>masters jeweler shelby township mchigan troops</a></li> <li><a href=http://qkgyh.hostei.com/?p=3024120>eco beach weekend caribbean contest</a></li> <li><a href=http://mhnvt.netne.net/?p=1718010>perth limos australia seventeen</a></li> <li><a href=http://krwdrpl.host56.com/?p=2409910>tatto point silk</a></li> <li><a href=http://socybqc.webatu.com/?p=1758810>popcorn machines rentals alimentos</a></li> <li><a href=http://qkgyh.hostei.com/?p=3031600>honor those they have slain controlled</a></li> <li><a href=http://dbvqidssb.webatu.com/?p=2142840>trolling motor bracket for canoes techniques</a></li> <li><a href=http://kthvlyp.webatu.com/?p=3882620>guaranteed funds check leaning</a></li> </div> <!-- linkkssl -->

<!-- analytics7 --> 
