<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Warrior Point</title>
	
	<link>http://www.warriorpoint.com/blog</link>
	<description>Latest News and Tutorials on Salesforce.com, SaaS, and on-demand software</description>
	<pubDate>Thu, 02 Jul 2009 02:14:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/WarriorPoint" type="application/rss+xml" /><item>
		<title>Android: Creating TableRow rows inside a TableLayout programatically</title>
		<link>http://feedproxy.google.com/~r/WarriorPoint/~3/gZk_5gDivjA/</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</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>
<img src="http://feeds.feedburner.com/~r/WarriorPoint/~4/gZk_5gDivjA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2009/07/01/android-creating-tablerow-rows-inside-a-tablelayout-programatically/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.warriorpoint.com/blog/2009/07/01/android-creating-tablerow-rows-inside-a-tablelayout-programatically/</feedburner:origLink></item>
		<item>
		<title>Android: Switching screens by dragging over the touch screen</title>
		<link>http://feedproxy.google.com/~r/WarriorPoint/~3/cYnqPqap0CQ/</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</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>
<img src="http://feeds.feedburner.com/~r/WarriorPoint/~4/cYnqPqap0CQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2009/05/29/android-switching-screens-by-dragging-over-the-touch-screen/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.warriorpoint.com/blog/2009/05/29/android-switching-screens-by-dragging-over-the-touch-screen/</feedburner:origLink></item>
		<item>
		<title>Android: Switching screens in an Activity with animations (using ViewFlipper)</title>
		<link>http://feedproxy.google.com/~r/WarriorPoint/~3/Khw8jNO4Huo/</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</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>
<img src="http://feeds.feedburner.com/~r/WarriorPoint/~4/Khw8jNO4Huo" height="1" width="1"/>]]></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>
		<feedburner:origLink>http://www.warriorpoint.com/blog/2009/05/26/android-switching-screens-in-an-activity-with-animations-using-viewflipper/</feedburner:origLink></item>
		<item>
		<title>Android: Reading Logs and Exceptions</title>
		<link>http://feedproxy.google.com/~r/WarriorPoint/~3/UmkK81FMMaM/</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</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>
<img src="http://feeds.feedburner.com/~r/WarriorPoint/~4/UmkK81FMMaM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2009/05/24/android-reading-logs-and-exceptions/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.warriorpoint.com/blog/2009/05/24/android-reading-logs-and-exceptions/</feedburner:origLink></item>
		<item>
		<title>Android: How to switch between Activities</title>
		<link>http://feedproxy.google.com/~r/WarriorPoint/~3/qGLVi8IOwd4/</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</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>
<img src="http://feeds.feedburner.com/~r/WarriorPoint/~4/qGLVi8IOwd4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2009/05/24/android-how-to-switch-between-activities/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.warriorpoint.com/blog/2009/05/24/android-how-to-switch-between-activities/</feedburner:origLink></item>
		<item>
		<title>Developer’s Perspective on Android: Getting Started</title>
		<link>http://feedproxy.google.com/~r/WarriorPoint/~3/nPv71g3vtJg/</link>
		<comments>http://www.warriorpoint.com/blog/2009/05/24/developers-perspective-on-android-getting-started/#comments</comments>
		<pubDate>Mon, 25 May 2009 01:49:15 +0000</pubDate>
		<dc:creator>Boyan</dc:creator>
		
		<category><![CDATA[Android]]></category>

		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://www.warriorpoint.com/blog/?p=297</guid>
		<description><![CDATA[
I’ve been a fan of Google’s mobile operating system Android for quite a while – technically since I heard about it 2 years ago. I’ve been unfortunate to live in Canada, because none of the telco companies here have carried any phones with Android (only HTC phones for now, but Samsung seems to be coming [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_298" class="wp-caption alignleft" style="width: 310px"><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/500px-android-logo_svg.png"><img class="size-medium wp-image-298" title="Google Android" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/05/500px-android-logo_svg-300x300.png" alt="Google Android" width="300" height="300" /></a><p class="wp-caption-text"> </p></div>
<p>I’ve been a fan of Google’s mobile operating system Android for quite a while – technically since I heard about it 2 years ago. I’ve been unfortunate to live in Canada, because none of the telco companies here have carried any phones with Android (only HTC phones for now, but Samsung seems to be coming out with something soon).</p>
<p>But, on June 2nd 2009 Rogers is coming out with the HTC Dream and the HTC Magic and Google Android will be here! And on June 3rd Google Android will be in my hands. [I’m not going to be a geek and get it on the very <em>first</em> day it comes out, come on!]</p>
<p>So, in expectation of this date, I started playing around with Android and developing my own applications. To start off, it’s been absolutely easy, pleasant, and a breeze to setup. It was like stealing candy from a kid. I followed the instructions from the Android – Developers website and using Eclipse as my environment I was creating mobile applications in less than 30 mins.</p>
<p>To get the SDK follow this link: <a title="http://developer.android.com/sdk/1.5_r2/index.html" href="http://developer.android.com/sdk/1.5_r2/index.html">http://developer.android.com/sdk/1.5_r2/index.html</a><br />
To read the installation instructions follow this link: <a title="http://developer.android.com/sdk/1.5_r2/installing.html" href="http://developer.android.com/sdk/1.5_r2/installing.html">http://developer.android.com/sdk/1.5_r2/installing.html</a><br />
And I recommend using Eclipse if you do want to get the “30 mins effect”.</p>
<p>I wanted to test out the different functions/features that Android offers out of the box, so I thought of a simple app which would allow me to have a goal and thus opportunities to experiment. I am going to write a “tax” application. Unfortunately, this tax application will not fill out your taxes. It will calculate how much the government has to take from you each year. You will enter your country (Canada only for now), you will enter your income, and the result will be a summary of your take-home pay and taxes due, by province (or states for the US – eventually). I’m going to call it “The Taxman”.</p>
<p>I’ve just started this mini app, and as I go along I will post snippets of code that I found difficult to come up with – to help out anyone that is looking for the exact same solution. Also, I have a full-time job, so it will take me a month to complete this silly app :), so my posts might be infrequent.</p>
<p>This weekend I had a chance to start it off and I had trouble with a couple of things. I will write a separate post on each one over the next couple of weeks. Here’s three of those things:</p>
<p>1. How to switch from one screen to another (also called Activities)</p>
<p>2. How to switch screens with an animation effect</p>
<p>3. How to switch screens using a dragging motion with your finger – you know, iPhone stylez.</p>
<p>That’s it for now… those 3 posts will be coming out very, very soon!</p>
<img src="http://feeds.feedburner.com/~r/WarriorPoint/~4/nPv71g3vtJg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2009/05/24/developers-perspective-on-android-getting-started/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.warriorpoint.com/blog/2009/05/24/developers-perspective-on-android-getting-started/</feedburner:origLink></item>
		<item>
		<title>Checking up on the On-Demand Index</title>
		<link>http://feedproxy.google.com/~r/WarriorPoint/~3/Y2H1CVUbmDE/</link>
		<comments>http://www.warriorpoint.com/blog/2009/01/31/checking-up-on-the-on-demand-index/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 02:41:26 +0000</pubDate>
		<dc:creator>Boyan</dc:creator>
		
		<category><![CDATA[On-Demand Index]]></category>

		<guid isPermaLink="false">http://www.warriorpoint.com/blog/?p=266</guid>
		<description><![CDATA[I decided to get off my lazy butt, after 3 months of non-posts, and check up on something. Some time ago I wrote a post about an &#8220;On-Demand Index&#8221;. This was a portfolio of On-Demand/SaaS stocks picked by Rick Sherman on SeekingAlpha.com. I created some AJAX scripts that took data from Google Finance for that [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to get off my lazy butt, after 3 months of non-posts, and check up on something. Some time ago I wrote a post about an <a href="http://www.warriorpoint.com/blog/2008/07/11/saas-stocks-the-on-demand-index-is-now-dynamic-and-up-to-date/" target="_blank">&#8220;On-Demand Index&#8221;</a>. This was a portfolio of On-Demand/SaaS stocks picked by Rick Sherman on SeekingAlpha.com. I created some AJAX scripts that took data from Google Finance for that portfolio and made it into <a href="http://www.warriorpoint.com/blog/on-demand-index/" target="_blank">a page on this blog</a>. I thought, this way you can always go to that page and see overall how the SaaS stocks are doing in real-time.</p>
<p>Well, here I am, half a year later, trying to find out what happened to those stocks.</p>
<p>This is the original chart from June 29th 2008 that got me started:<br />
<a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/01/junestocks.bmp"><img class="alignnone size-medium wp-image-268" title="junestocks" src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/01/junestocks.bmp" alt="On-Demand index June 29th" /></a></p>
<p>This is the chart on January 1st 2009, from the On-Demand Index page:</p>
<table border="1">
<tbody>
<tr style="font-weight: bold; background-color: #ffcc33;">
<td id="Td13">Company</td>
<td id="Td14">Symbol</td>
<td id="Td15" align="right">Return since Jan</td>
<td id="Td16" align="right">Return last 1 year</td>
<td id="Td17" align="right">Latest Price</td>
<td id="Td18" align="right">52 High</td>
<td id="Td19" align="right">52 Low</td>
<td id="Td20" align="right">EPS</td>
<td id="Td21" align="right">P/E</td>
<td id="Td22" align="right">Market Cap</td>
</tr>
<tr>
<td id="ATHN_Name">athenahealth, Inc.</td>
<td id="ATHN_Symbol"><a href="http://finance.google.com/finance?q=ATHN&amp;hl=en" target="_blank">ATHN</a></td>
<td id="ATHN_Price" align="right">1.32%</td>
<td id="ATHN_MarketCap" align="right">8.54%</td>
<td id="ATHN_PE" align="right">36.08</td>
<td id="ATHN_High52" align="right">39.29</td>
<td id="ATHN_Low52" align="right">19.19</td>
<td id="ATHN_EPS" align="right">0.30</td>
<td id="ATHN_ReturnJan" align="right">118.56</td>
<td id="ATHN_ReturnYear" align="right">1.20B</td>
</tr>
<tr style="background-color: #e6e6e6;">
<td id="BBBB_Name">Blackboard, Inc.</td>
<td id="BBBB_Symbol"><a href="http://finance.google.com/finance?q=BBBB&amp;hl=en" target="_blank">BBBB</a></td>
<td id="BBBB_Price" style="color: red;" align="right">-5.15%</td>
<td id="BBBB_MarketCap" style="color: red;" align="right">-27.17%</td>
<td id="BBBB_PE" align="right">25.41</td>
<td id="BBBB_High52" align="right">45.00</td>
<td id="BBBB_Low52" align="right">19.36</td>
<td id="BBBB_EPS" align="right">0.13</td>
<td id="BBBB_ReturnJan" align="right">199.39</td>
<td id="BBBB_ReturnYear" align="right">796.66M</td>
</tr>
<tr>
<td id="CNQR_Name">Concur Technologies, Inc.</td>
<td id="CNQR_Symbol"><a href="http://finance.google.com/finance?q=CNQR&amp;hl=en" target="_blank">CNQR</a></td>
<td id="CNQR_Price" style="color: red;" align="right">-26.03%</td>
<td id="CNQR_MarketCap" style="color: red;" align="right">-32.19%</td>
<td id="CNQR_PE" align="right">24.69</td>
<td id="CNQR_High52" align="right">50.00</td>
<td id="CNQR_Low52" align="right">19.52</td>
<td id="CNQR_EPS" align="right">0.35</td>
<td id="CNQR_ReturnJan" align="right">69.91</td>
<td id="CNQR_ReturnYear" align="right">1.21B</td>
</tr>
<tr style="background-color: #e6e6e6;">
<td id="CRM_Name">salesforce.com, Inc.</td>
<td id="CRM_Symbol"><a href="http://finance.google.com/finance?q=CRM&amp;hl=en" target="_blank">CRM</a></td>
<td id="CRM_Price" style="color: red;" align="right">-21.78%</td>
<td id="CRM_MarketCap" style="color: red;" align="right">-48.55%</td>
<td id="CRM_PE" align="right">26.61</td>
<td id="CRM_High52" align="right">75.21</td>
<td id="CRM_Low52" align="right">20.82</td>
<td id="CRM_EPS" align="right">0.30</td>
<td id="CRM_ReturnJan" align="right">89.61</td>
<td id="CRM_ReturnYear" align="right">3.25B</td>
</tr>
<tr>
<td id="CTCT_Name">Constant Contact, Inc.</td>
<td id="CTCT_Symbol"><a href="http://finance.google.com/finance?q=CTCT&amp;hl=en" target="_blank">CTCT</a></td>
<td id="CTCT_Price" align="right">10.01%</td>
<td id="CTCT_MarketCap" style="color: red;" align="right">-26.02%</td>
<td id="CTCT_PE" align="right">15.27</td>
<td id="CTCT_High52" align="right">21.84</td>
<td id="CTCT_Low52" align="right">0.01</td>
<td id="CTCT_EPS" style="color: red;" align="right">-0.06</td>
<td id="CTCT_ReturnJan" align="right">-</td>
<td id="CTCT_ReturnYear" align="right">429.46M</td>
</tr>
<tr style="background-color: #e6e6e6;">
<td id="DMAN_Name">DemandTec, Inc.</td>
<td id="DMAN_Symbol"><a href="http://finance.google.com/finance?q=DMAN&amp;hl=en" target="_blank">DMAN</a></td>
<td id="DMAN_Price" style="color: red;" align="right">-22.27%</td>
<td id="DMAN_MarketCap" style="color: red;" align="right">-44.67%</td>
<td id="DMAN_PE" align="right">6.70</td>
<td id="DMAN_High52" align="right">13.10</td>
<td id="DMAN_Low52" align="right">5.77</td>
<td id="DMAN_EPS" style="color: red;" align="right">-0.17</td>
<td id="DMAN_ReturnJan" align="right">-</td>
<td id="DMAN_ReturnYear" align="right">186.47M</td>
</tr>
<tr>
<td id="KNXA_Name">Kenexa Corporation</td>
<td id="KNXA_Symbol"><a href="http://finance.google.com/finance?q=KNXA&amp;hl=en" target="_blank">KNXA</a></td>
<td id="KNXA_Price" style="color: red;" align="right">-10.78%</td>
<td id="KNXA_MarketCap" style="color: red;" align="right">-62.05%</td>
<td id="KNXA_PE" align="right">6.79</td>
<td id="KNXA_High52" align="right">24.01</td>
<td id="KNXA_Low52" align="right">4.68</td>
<td id="KNXA_EPS" align="right">0.94</td>
<td id="KNXA_ReturnJan" align="right">7.24</td>
<td id="KNXA_ReturnYear" align="right">153.18M</td>
</tr>
<tr style="background-color: #e6e6e6;">
<td id="LOOP_Name">LoopNet, Inc.</td>
<td id="LOOP_Symbol"><a href="http://finance.google.com/finance?q=LOOP&amp;hl=en" target="_blank">LOOP</a></td>
<td id="LOOP_Price" style="color: red;" align="right">-6.07%</td>
<td id="LOOP_MarketCap" style="color: red;" align="right">-56.35%</td>
<td id="LOOP_PE" align="right">6.50</td>
<td id="LOOP_High52" align="right">15.48</td>
<td id="LOOP_Low52" align="right">4.75</td>
<td id="LOOP_EPS" align="right">0.52</td>
<td id="LOOP_ReturnJan" align="right">12.56</td>
<td id="LOOP_ReturnYear" align="right">222.78M</td>
</tr>
<tr>
<td id="N_Name">Netsuite Inc</td>
<td id="N_Symbol"><a href="http://finance.google.com/finance?q=N&amp;hl=en" target="_blank">N</a></td>
<td id="N_Price" style="color: red;" align="right">-16.67%</td>
<td id="N_MarketCap" style="color: red;" align="right">-74.22%</td>
<td id="N_PE" align="right">7.00</td>
<td id="N_High52" align="right">28.84</td>
<td id="N_Low52" align="right">5.43</td>
<td id="N_EPS" style="color: red;" align="right">-0.40</td>
<td id="N_ReturnJan" align="right">-</td>
<td id="N_ReturnYear" align="right">425.85M</td>
</tr>
<tr style="background-color: #e6e6e6;">
<td id="OMTR_Name">Omniture, Inc.</td>
<td id="OMTR_Symbol"><a href="http://finance.google.com/finance?q=OMTR&amp;hl=en" target="_blank">OMTR</a></td>
<td id="OMTR_Price" style="color: red;" align="right">-17.51%</td>
<td id="OMTR_MarketCap" style="color: red;" align="right">-66.58%</td>
<td id="OMTR_PE" align="right">9.09</td>
<td id="OMTR_High52" align="right">28.00</td>
<td id="OMTR_Low52" align="right">7.15</td>
<td id="OMTR_EPS" style="color: red;" align="right">-0.55</td>
<td id="OMTR_ReturnJan" align="right">-</td>
<td id="OMTR_ReturnYear" align="right">662.94M</td>
</tr>
<tr>
<td id="RNOW_Name">RightNow Technologies</td>
<td id="RNOW_Symbol"><a href="http://finance.google.com/finance?q=RNOW&amp;hl=en" target="_blank">RNOW</a></td>
<td id="RNOW_Price" style="color: red;" align="right">-30.48%</td>
<td id="RNOW_MarketCap" style="color: red;" align="right">-50.47%</td>
<td id="RNOW_PE" align="right">5.84</td>
<td id="RNOW_High52" align="right">17.39</td>
<td id="RNOW_Low52" align="right">5.02</td>
<td id="RNOW_EPS" style="color: red;" align="right">-0.34</td>
<td id="RNOW_ReturnJan" align="right">-</td>
<td id="RNOW_ReturnYear" align="right">195.66M</td>
</tr>
<tr style="background-color: #e6e6e6;">
<td id="SFSF_Name">SuccessFactors, Inc.</td>
<td id="SFSF_Symbol"><a href="http://finance.google.com/finance?q=SFSF&amp;hl=en" target="_blank">SFSF</a></td>
<td id="SFSF_Price" align="right">16.64%</td>
<td id="SFSF_MarketCap" style="color: red;" align="right">-26.04%</td>
<td id="SFSF_PE" align="right">6.73</td>
<td id="SFSF_High52" align="right">15.00</td>
<td id="SFSF_Low52" align="right">4.61</td>
<td id="SFSF_EPS" style="color: red;" align="right">-1.64</td>
<td id="SFSF_ReturnJan" align="right">-</td>
<td id="SFSF_ReturnYear" align="right">377.61M</td>
</tr>
<tr>
<td id="SLRY_Name">Salary.com, Inc.</td>
<td id="SLRY_Symbol"><a href="http://finance.google.com/finance?q=SLRY&amp;hl=en" target="_blank">SLRY</a></td>
<td id="SLRY_Price" style="color: red;" align="right">-32.95%</td>
<td id="SLRY_MarketCap" style="color: red;" align="right">-81.37%</td>
<td id="SLRY_PE" align="right">1.77</td>
<td id="SLRY_High52" align="right">11.00</td>
<td id="SLRY_Low52" align="right">1.40</td>
<td id="SLRY_EPS" style="color: red;" align="right">-1.32</td>
<td id="SLRY_ReturnJan" align="right">-</td>
<td id="SLRY_ReturnYear" align="right">29.09M</td>
</tr>
<tr style="background-color: #e6e6e6;">
<td id="TLEO_Name">Taleo Corporation</td>
<td id="TLEO_Symbol"><a href="http://finance.google.com/finance?q=TLEO&amp;hl=en" target="_blank">TLEO</a></td>
<td id="TLEO_Price" align="right">5.24%</td>
<td id="TLEO_MarketCap" style="color: red;" align="right">-61.7%</td>
<td id="TLEO_PE" align="right">8.43</td>
<td id="TLEO_High52" align="right">26.16</td>
<td id="TLEO_Low52" align="right">5.37</td>
<td id="TLEO_EPS" style="color: red;" align="right">-0.08</td>
<td id="TLEO_ReturnJan" align="right">-</td>
<td id="TLEO_ReturnYear" align="right">258.04M</td>
</tr>
<tr>
<td id="TRAK_Name">DealerTrack Holdings, Inc.</td>
<td id="TRAK_Symbol"><a href="http://finance.google.com/finance?q=TRAK&amp;hl=en" target="_blank">TRAK</a></td>
<td id="TRAK_Price" style="color: red;" align="right">-7.7%</td>
<td id="TRAK_MarketCap" style="color: red;" align="right">-59.75%</td>
<td id="TRAK_PE" align="right">11.39</td>
<td id="TRAK_High52" align="right">28.75</td>
<td id="TRAK_Low52" align="right">8.84</td>
<td id="TRAK_EPS" align="right">0.16</td>
<td id="TRAK_ReturnJan" align="right">72.46</td>
<td id="TRAK_ReturnYear" align="right">453.67M</td>
</tr>
<tr>
<td id="ULTI_Name">The Ultimate Software Group</td>
<td id="ULTI_Symbol"><a href="http://finance.google.com/finance?q=ULTI&amp;hl=en" target="_blank">ULTI</a></td>
<td id="ULTI_Price" style="color: red;" align="right">-14.15%</td>
<td id="ULTI_MarketCap" style="color: red;" align="right">-52.7%</td>
<td id="ULTI_PE" align="right">13.77</td>
<td id="ULTI_High52" align="right">41.68</td>
<td id="ULTI_Low52" align="right">10.70</td>
<td id="ULTI_EPS" align="right">0.72</td>
<td id="ULTI_ReturnJan" align="right">19.16</td>
<td id="ULTI_ReturnYear" align="right">336.52M</td>
</tr>
<tr style="background-color: #e6e6e6;">
<td id="VOCS_Name">Vocus, Inc.</td>
<td id="VOCS_Symbol"><a href="http://finance.google.com/finance?q=VOCS&amp;hl=en" target="_blank">VOCS</a></td>
<td id="VOCS_Price" style="color: red;" align="right">-19%</td>
<td id="VOCS_MarketCap" style="color: red;" align="right">-48.86%</td>
<td id="VOCS_PE" align="right">15.26</td>
<td id="VOCS_High52" align="right">41.50</td>
<td id="VOCS_Low52" align="right">12.90</td>
<td id="VOCS_EPS" align="right">0.31</td>
<td id="VOCS_ReturnJan" align="right">48.50</td>
<td id="VOCS_ReturnYear" align="right">290.29M</td>
</tr>
<tr style="font-weight: bold; background-color: #ffcc33;">
<td id="TOTAL_Name">TOTAL</td>
<td id="TOTAL_Symbol"> </td>
<td id="TOTAL_RunningJan" style="color: red;" align="right">-11.61%</td>
<td id="TOTAL_RunningYear" style="color: red;" align="right">-47.66%</td>
<td id="TOTAL_PE"> </td>
<td id="TOTAL_High52"> </td>
<td id="TOTAL_Low52"> </td>
<td id="TOTAL_EPS"> </td>
<td id="TOTAL_ReturnJan"> </td>
<td id="TOTAL_ReturnYear"> </td>
</tr>
</tbody>
</table>
<p>Yikes! The return over the last year is -47%! The return since Jan 1 is -11%!</p>
<p>There is only ONE company on that list that has posted an increase in the past half year,<br />
<strong>athenahealth (ATHN)<br />
</strong>June 2008: 30.2<br />
January 2009: 36.08<br />
%: 19.47%</p>
<p>All the others are in the red, with an honourable mention going to<br />
<strong>Salesforce.com (CRM)</strong><br />
June 2008: 68.6<br />
January 2009: 26.61<br />
%: -61.2%</p>
<p>Here&#8217;s a complete listing of the changes since June 2008:</p>
<table style="width: 600px;" border="1">
<tbody>
<tr style="background-color:#FFCC33; font-weight:bold; ">
<td id="Td13">Company</td>
<td id="Td14" width="100">Symbol</td>
<td id="Td15" width="70" align="right">Jun-08</td>
<td id="Td16" width="70" align="right">Jan-09</td>
<td id="Td17" width="70" align="right">%</td>
</tr>
<tr>
<td id="ATHN_Name">athenahealth, Inc.</td>
<td id="ATHN_Symbol"><a href="http://finance.google.com/finance?q=ATHN&amp;hl=en" target="_blank">ATHN</a></td>
<td id="ATHN_Price" style="TEXT-ALIGN: right">30.2</td>
<td id="ATHN_MarketCap" style="text-align: right;"> 36.08</td>
<td id="ATHN_PE" style="text-align: right;"> 19.47</td>
</tr>
<tr style="background-color:#E6E6E6; ">
<td id="BBBB_Name">Blackboard, Inc.</td>
<td id="BBBB_Symbol"><a href="http://finance.google.com/finance?q=BBBB&amp;hl=en" target="_blank">BBBB</a></td>
<td id="BBBB_Price" style="TEXT-ALIGN: right">39.4</td>
<td id="BBBB_MarketCap" style="text-align: right;"> 25.41</td>
<td id="BBBB_PE" style="text-align: right;"><span style="color: #ff0000;"> -35.51</span></td>
</tr>
<tr>
<td id="CNQR_Name">Concur Technologies, Inc.</td>
<td id="CNQR_Symbol"><a href="http://finance.google.com/finance?q=CNQR&amp;hl=en" target="_blank">CNQR</a></td>
<td id="CNQR_Price" style="TEXT-ALIGN: right">34.3</td>
<td id="CNQR_MarketCap" style="text-align: right;"> 24.69</td>
<td id="CNQR_PE" style="text-align: right;"><span style="color: #ff0000;"> -28.02</span></td>
</tr>
<tr style="background-color:#E6E6E6; ">
<td id="CRM_Name">salesforce.com, Inc.</td>
<td id="CRM_Symbol"><a href="http://finance.google.com/finance?q=CRM&amp;hl=en" target="_blank">CRM</a></td>
<td id="CRM_Price" style="TEXT-ALIGN: right">68.6</td>
<td id="CRM_MarketCap" style="text-align: right;"> 26.61</td>
<td id="CRM_PE" style="text-align: right;"><span style="color: #ff0000;"> -62.21</span></td>
</tr>
<tr>
<td id="CTCT_Name">Constant Contact, Inc.</td>
<td id="CTCT_Symbol"><a href="http://finance.google.com/finance?q=CTCT&amp;hl=en" target="_blank">CTCT</a></td>
<td id="CTCT_Price" style="TEXT-ALIGN: right">19</td>
<td id="CTCT_MarketCap" style="text-align: right;"> 15.27</td>
<td id="CTCT_PE" style="text-align: right;"> <span style="color: #ff0000;">-19.63</span></td>
</tr>
<tr style="background-color:#E6E6E6; ">
<td id="DMAN_Name">DemandTec, Inc.</td>
<td id="DMAN_Symbol"><a href="http://finance.google.com/finance?q=DMAN&amp;hl=en" target="_blank">DMAN</a></td>
<td id="DMAN_Price" style="TEXT-ALIGN: right">7.93</td>
<td id="DMAN_MarketCap" style="text-align: right;"> 6.7</td>
<td id="DMAN_PE" style="text-align: right;"> <span style="color: #ff0000;">-15.51</span></td>
</tr>
<tr>
<td id="KNXA_Name">Kenexa Corporation</td>
<td id="KNXA_Symbol"><a href="http://finance.google.com/finance?q=KNXA&amp;hl=en" target="_blank">KNXA</a></td>
<td id="KNXA_Price" style="TEXT-ALIGN: right">19.7</td>
<td id="KNXA_MarketCap" style="text-align: right;"> 6.79</td>
<td id="KNXA_PE" style="text-align: right;"><span style="color: #ff0000;"> -65.53</span></td>
</tr>
<tr style="background-color:#E6E6E6; ">
<td id="LOOP_Name">LoopNet, Inc.</td>
<td id="LOOP_Symbol"><a href="http://finance.google.com/finance?q=LOOP&amp;hl=en" target="_blank">LOOP</a></td>
<td id="LOOP_Price" style="TEXT-ALIGN: right">11.1</td>
<td id="LOOP_MarketCap" style="text-align: right;"> 6.5</td>
<td id="LOOP_PE" style="text-align: right;"><span style="color: #ff0000;"> -41.44</span></td>
</tr>
<tr>
<td id="N_Name">Netsuite Inc</td>
<td id="N_Symbol"><a href="http://finance.google.com/finance?q=N&amp;hl=en" target="_blank">N</a></td>
<td id="N_Price" style="TEXT-ALIGN: right">20.3</td>
<td id="N_MarketCap" style="text-align: right;"> 7</td>
<td id="N_PE" style="text-align: right;"> <span style="color: #ff0000;">-65.52</span></td>
</tr>
<tr style="background-color:#E6E6E6; ">
<td id="OMTR_Name">Omniture, Inc.</td>
<td id="OMTR_Symbol"><a href="http://finance.google.com/finance?q=OMTR&amp;hl=en" target="_blank">OMTR</a></td>
<td id="OMTR_Price" style="TEXT-ALIGN: right">19.9</td>
<td id="OMTR_MarketCap" style="text-align: right;"> 9.09</td>
<td id="OMTR_PE" style="text-align: right;"><span style="color: #ff0000;"> -54.32</span></td>
</tr>
<tr>
<td id="RNOW_Name">RightNow Technologies</td>
<td id="RNOW_Symbol"><a href="http://finance.google.com/finance?q=RNOW&amp;hl=en" target="_blank">RNOW</a></td>
<td id="RNOW_Price" style="TEXT-ALIGN: right">13.7</td>
<td id="RNOW_MarketCap" style="text-align: right;"> 5.84</td>
<td id="RNOW_PE" style="text-align: right;"><span style="color: #ff0000;"> -57.37</span></td>
</tr>
<tr style="background-color:#E6E6E6; ">
<td id="SFSF_Name">SuccessFactors, Inc.</td>
<td id="SFSF_Symbol"><a href="http://finance.google.com/finance?q=SFSF&amp;hl=en" target="_blank">SFSF</a></td>
<td id="SFSF_Price" style="text-align: right;"> 11</td>
<td id="SFSF_MarketCap" style="text-align: right;"> 6.73</td>
<td id="SFSF_PE" style="text-align: right;"><span style="color: #ff0000;"> -38.82</span></td>
</tr>
<tr>
<td id="SLRY_Name">Salary.com, Inc.</td>
<td id="SLRY_Symbol"><a href="http://finance.google.com/finance?q=SLRY&amp;hl=en" target="_blank">SLRY</a></td>
<td id="SLRY_Price" style="text-align: right;"> 4</td>
<td id="SLRY_MarketCap" style="text-align: right;"> 1.77</td>
<td id="SLRY_PE" style="text-align: right;"><span style="color: #ff0000;"> -55.75</span></td>
</tr>
<tr style="background-color:#E6E6E6; ">
<td id="TLEO_Name">Taleo Corporation</td>
<td id="TLEO_Symbol"><a href="http://finance.google.com/finance?q=TLEO&amp;hl=en" target="_blank">TLEO</a></td>
<td id="TLEO_Price" style="text-align: right;"> 19.6</td>
<td id="TLEO_MarketCap" style="text-align: right;"> 8.43</td>
<td id="TLEO_PE" style="text-align: right;"><span style="color: #ff0000;"> -56.99</span></td>
</tr>
<tr>
<td id="TRAK_Name">DealerTrack Holdings, Inc.</td>
<td id="TRAK_Symbol"><a href="http://finance.google.com/finance?q=TRAK&amp;hl=en" target="_blank">TRAK</a></td>
<td id="TRAK_Price" style="text-align: right;"> 15.5</td>
<td id="TRAK_MarketCap" style="text-align: right;"> 11.39</td>
<td id="TRAK_PE" style="text-align: right;"><span style="color: #ff0000;"> -26.52</span></td>
</tr>
<tr>
<td id="ULTI_Name">The Ultimate Software Group</td>
<td id="ULTI_Symbol"><a href="http://finance.google.com/finance?q=ULTI&amp;hl=en" target="_blank">ULTI</a></td>
<td id="ULTI_Price" style="text-align: right;"> 36.7</td>
<td id="ULTI_MarketCap" style="text-align: right;"> 13.77</td>
<td id="ULTI_PE" style="text-align: right;"><span style="color: #ff0000;"> -62.48</span></td>
</tr>
<tr style="background-color:#E6E6E6; ">
<td id="VOCS_Name">Vocus, Inc.</td>
<td id="VOCS_Symbol"><a href="http://finance.google.com/finance?q=VOCS&amp;hl=en" target="_blank">VOCS</a></td>
<td id="VOCS_Price" style="text-align: right;"> 32.4</td>
<td id="VOCS_MarketCap" style="text-align: right;"> 15.26</td>
<td id="VOCS_PE" style="text-align: right;"><span style="color: #ff0000;"> -52.90</span></td>
</tr>
<tr style="background-color:#FFCC33; font-weight:bold; ">
<td id="TOTAL_Name">TOTAL</td>
<td id="TOTAL_Symbol"> </td>
<td id="TOTAL_RunningJan" align="right"> </td>
<td id="TOTAL_RunningYear" align="right"> </td>
<td id="TOTAL_PE" style="text-align: right;"><span style="color: #ff0000;"> -42.44</span></td>
</tr>
</tbody>
</table>
<p>
Ok, ok, you can blame the economy.  But maybe the market still hasn&#8217;t warmed up to the idea of SaaS as much as this blog has. Or, just as the <a href="http://www.warriorpoint.com/blog/2008/07/02/whether-you-invest-in-saas-stocks-or-not-dont-forget-the-fundamentals/" target="_blank">original article </a>claims, these are companies just like any other and they are suffering the same ups and downs as all other companies - the industry they are in is just a small portion of the overall formula.</p>
<p>For example, salesforce was hugely overvalued at $60 (personal opinion), while athenahealth keeps signing more contracts <a href="http://www.businesswire.com/portal/site/google/?ndmViewId=news_view&amp;newsId=20090122005106&amp;newsLang=en" target="_blank">[1]</a> <a href="http://www.businesswire.com/portal/site/google/?ndmViewId=news_view&amp;newsId=20090127005109&amp;newsLang=en" target="_blank">[2]</a>.</p>
<p>I really want to say: look, all companies but one have posted decreases, this means SaaS is still new and not being adopted. However, I know in my heart that so many companies in the red must have some kind of influence from the sagging economy. It would be quite the coincidence if they are all red because of their industry.</p>
<p>That&#8217;s all for now. I will check back on these stocks soon. Maybe when the economoy is stabalized in 2 years, looking at these figures will make more sense.</p>
<img src="http://feeds.feedburner.com/~r/WarriorPoint/~4/Y2H1CVUbmDE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2009/01/31/checking-up-on-the-on-demand-index/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.warriorpoint.com/blog/2009/01/31/checking-up-on-the-on-demand-index/</feedburner:origLink></item>
		<item>
		<title>Multitenancy has nothing to do with SaaS</title>
		<link>http://feedproxy.google.com/~r/WarriorPoint/~3/7HIGBYChcNs/</link>
		<comments>http://www.warriorpoint.com/blog/2009/01/14/multitenancy-has-nothing-to-do-with-saas/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 08:04:20 +0000</pubDate>
		<dc:creator>Darren</dc:creator>
		
		<category><![CDATA[SaaS]]></category>

		<guid isPermaLink="false">http://www.warriorpoint.com/blog/?p=253</guid>
		<description><![CDATA[I came across this article today on Forbes.  Dan Woods tries to dig a little deeper into what has made Salesforce.com so successful.  In the end, Dan boils it down to the fact that Salesforce.com is not successfully solely because they were the first to provide multitenant software at a large scale.  [...]]]></description>
			<content:encoded><![CDATA[<p>I came across this article today on <a target="_blank" href="http://www.forbes.com/technology/2009/01/12/cio-salesforce-multitenancy-tech-cio-cx_dw_0113salesforce.html">Forbes</a>.  Dan Woods tries to dig a little deeper into what has made Salesforce.com so successful.  In the end, Dan boils it down to the fact that Salesforce.com is not successfully solely because they were the first to provide multitenant software at a large scale.  It was the fact that solved a critical problem most people overlooked.  They made highly configurable enterprise software; one that could be configured intuitively without a computer science degree.  By making multitenancy a constraint, it probably forced their engineers to build very malleable software that solves many of their customer&#8217;s problems right out of the box.  It could also be the fact that they chose CRM software which requirements don&#8217;t vary drastically from company to company.</p>
<p>Either way, if a company made single tenant software that had superb usability and configure-ability; would it still garner the same success? I&#8217;ve said it <a target="_blank" href="http://www.warriorpoint.com/blog/2008/06/19/the-different-flavours-of-multi-tenancy/">before</a>; software as a service is just that, a service.  It doesn&#8217;t matter what architecture.  As long as your customers don&#8217;t own and maintain the software or the hardware then that&#8217;s &#8220;service&#8221;.  It doesn&#8217;t matter what flavor it comes in.  This is one of those terms that the marketing department keeps hyping up to prove that there really is some innovation in their software.  Because in this world, big words sell software.  Don&#8217;t let a <a target="_blank" href="http://www.joelonsoftware.com/articles/Stupidity.html">Suit</a> with a degree in International Relations fool you next time.  They&#8217;re wasting blog paper!</p>
<img src="http://feeds.feedburner.com/~r/WarriorPoint/~4/7HIGBYChcNs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2009/01/14/multitenancy-has-nothing-to-do-with-saas/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.warriorpoint.com/blog/2009/01/14/multitenancy-has-nothing-to-do-with-saas/</feedburner:origLink></item>
		<item>
		<title>Microsoft’s New Years Resolution: Innovate</title>
		<link>http://feedproxy.google.com/~r/WarriorPoint/~3/c7NZlosOp2A/</link>
		<comments>http://www.warriorpoint.com/blog/2009/01/13/microsoftinnovat/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 08:14:39 +0000</pubDate>
		<dc:creator>Darren</dc:creator>
		
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.warriorpoint.com/blog/?p=243</guid>
		<description><![CDATA[
Let&#8217;s be honest, not many people would say Microsoft are the most innovate.  They&#8217;re almost never the first to market but you have to give them credit;  over time they dominate any market they enter.  Or as Steve Ballmer puts it, they just keep &#8220;Coming and Coming and Coming&#8221;  There are [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.warriorpoint.com/blog/wp-content/uploads/2009/01/livedesktop.jpg"><img src="http://www.warriorpoint.com/blog/wp-content/uploads/2009/01/livedesktop.jpg" alt="" title="livedesktop" width="450" height="227" class="aligncenter size-full wp-image-244" /></a><br />
Let&#8217;s be honest, not many people would say Microsoft are the most innovate.  They&#8217;re almost never the first to market but you have to give them credit;  over time they dominate any market they enter.  Or as Steve Ballmer puts it, they just keep &#8220;Coming and Coming and Coming&#8221; <img src='http://www.warriorpoint.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> There are lots of examples, just look at: Internet Explorer,  Office,  Exchange, SQL Server and XBox. </p>
<p>Just a few days ago, <a target="_blank" href="https://www.mesh.com/Welcome/default.aspx">Microsoft&#8217;s Live Mesh</a> was awarded Best Technology Innovation / Achievement at the <a target="_blank" href="http://www.techcrunch.com/2009/01/10/congratulations-to-the-crunchies-winners-facebook-takes-top-prize-for-second-year/">Crunchies</a> awards.  Sure this is no Garnter.  But it&#8217;s one of the only times that a bunch of Google-horny journalist admit that Microsoft has made a great product.  Not surprisingly, Live Mesh is a product that I extremely love.  I&#8217;ve been harping about it to all my friends. </p>
<p>To put simply, Live Mesh&#8217;s strategy is to enhance the Windows platform.  To webify it if you will.  You install Mesh on all your devices and it will keep your files and folder in sync all the time.  You&#8217;re probably thinking &#8220;OK, so what&#8221;.  Built into Mesh is the Live Desktop so you no longer need to be at your computer to access your files.  All you need is a computer with Internet access.  In fact, the Live Desktop is so slick that it feels like you&#8217;re using Remote Desktop through the browser.  The more I use Mesh, the more I find ways to make my life easier.  This is what I can do with Mesh:</p>
<ul>
<li>Work on a file on my desktop, close it, go home and continue working on it from my laptop.  No uploading required</li>
<li>Keep my IE bookmarks in sync on all my computers</li>
<li>Have the code I&#8217;m working on available anywhere without checking it in</li>
<li>My music is available on all my devices</li>
<li>Install Mesh on my phone, take a picture and it&#8217;s on my desktop.  Goodbye USB cable</li>
<li>Share files with my friends by dragging it into a folder</li>
<li>My data is always backed up on another machine or in the cloud</li>
</ul>
<p>Mesh is one of the components of Microsoft&#8217;s Azure strategy.  The other half is focused on providing managed hosting for applications and services.  Although Mesh is a little further developed than the other components of Azure, I&#8217;m really looking forward to what Microsoft releases in the coming year.  And for all those &#8220;<a target="_blank" href="http://www.appirio.com/blog/2008/12/2009-predictions-azure-disappoints.php">2009</a>&#8221; predictions &#8230; really?</p>
<p>Feel free to try <a target="_blank" href="https://www.mesh.com/Welcome/default.aspx">Live Mesh</a> today!</p>
<img src="http://feeds.feedburner.com/~r/WarriorPoint/~4/c7NZlosOp2A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2009/01/13/microsoftinnovat/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.warriorpoint.com/blog/2009/01/13/microsoftinnovat/</feedburner:origLink></item>
		<item>
		<title>Recession Proof SaaS</title>
		<link>http://feedproxy.google.com/~r/WarriorPoint/~3/oUj5J52sym8/</link>
		<comments>http://www.warriorpoint.com/blog/2008/11/17/recession-proof-saas/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 06:36:05 +0000</pubDate>
		<dc:creator>Darren</dc:creator>
		
		<category><![CDATA[SaaS]]></category>

		<guid isPermaLink="false">http://www.warriorpoint.com/blog/?p=235</guid>
		<description><![CDATA[Naturally the most discussed topic right now is how this &#8220;economic crisis&#8221; is going to affect the SaaS business.  Will the lower cost of ownership finally persuade CIOs to adopt SaaS?  Or will all the small businesses (which make up a majority of SaaS revenues) go bankrupt drying up the wells of &#8216;recurring [...]]]></description>
			<content:encoded><![CDATA[<p>Naturally the most discussed topic right now is how this &#8220;economic crisis&#8221; is going to affect the SaaS business.  Will the lower cost of ownership finally persuade CIOs to adopt SaaS?  Or will all the small businesses (which make up a majority of SaaS revenues) go bankrupt drying up the wells of &#8216;recurring revenue&#8217; that most software companies depend on?  It&#8217;s a tough question.</p>
<p>Sinclair Schuller over at <a href="http://www.saasblogs.com/2008/11/13/can-isvs-benefit-by-moving-to-saas-in-a-bad-economy/" target="_blank">SaaS Blogs</a> poses an interesting question: Is it the right time for ISVs to enter the SaaS market in this economy? Will the economic turmoil provide an big opportunity for subscription software?</p>
<p>Sinclair argues that companies aren&#8217;t looking to cut monthly recurring expenses to reduce cost.  Instead they&#8217;re looking to cut large expenditures or big ticket items that will make a significant dent on cost.  Therefore Schuller argues that SaaS is, in a sense, is immune to corporate downsizing for the reasons above.</p>
<p>I&#8217;d like to add my thoughts to this discussion.  First of all let&#8217;s assume that we&#8217;re talking about software that is business critical like CRM or ERP.  As a SaaS provider, your product has to have some degree of importance for your customers&#8217; day-to-day operation.  Otherwise, it doesn&#8217;t matter economic crisis or not, you&#8217;ll be out of business sooner or later.</p>
<p>With this in mind, I would say that companies ARE NOT going to make an all-or-nothing decision.  The CIO is not going to say &#8220;Should we completely scrap our Salesforce CRM to cut costs?&#8221;  Instead, they will begin to throttle their consumption of these services to reduce their monthly costs.  I mean isn&#8217;t this the value prop for SaaS?  So instead of doing the right thing and buying a login for each employee.  They&#8217;ll start doubling up or sharing logins.  Or they&#8217;ll only provide logins for sales reps and not the marketing department.  Or they&#8217;ll downgrade their version since they extra features aren&#8217;t always mission critical.  Anyways you get the idea. Just think, when money is tight at home; you don&#8217;t stop eating you just eat less.  </p>
<p>So I&#8217;d suggest to ISVs looking at getting into SaaS to pay close attention to the pricing model and make it recession proof. Just because you offer hosted services doesn&#8217;t mean people will flock to your company.  This is not like the movie Field of Dreams with Kevin Costner where &#8220;if you build it, they will come&#8221;. </p>
<p>Take for example, Omniture.  Their pricing is NOT based on per user.  I can create as many users as I want because it&#8217;s based on the amount of data you send to their system.  Basically, Omniture is BI system where marketers can embed code into their website to collect data and analyze visitor behaviour.  In this case, you can&#8217;t really throttle the amount of money you spend on Omniture.  What you pay is directly related to the amount of traffic on your site.  And what are you going to do, tell people to stop visiting your site? Or will slowly stop implementing Omniture across your entire site? You could do that, but without the intelligence you wouldn&#8217;t be know how to enhance your site and generate more sales. So this doesn&#8217;t give customers a way to throttle their consumption but at the same time it provides a critical service for the company and thus cannot be axed altogether. </p>
<p>I think that&#8217;s the key.  Figure out a subscription model that is well within your customer&#8217;s budget make it difficult to throttle.  If you provide extreme value to your customers then it&#8217;s difficult to be on the cutting block.  It&#8217;s best to nail this down before acquiring a single customer.  The pricing model isn&#8217;t something that you can just change without pissing everybody off.  Why else do you think Telcos charge per minute for your mobile, but charge a flat rate for the landline? I bet it even costs the Telcos less when you make a call on your cell phone than your home phone.  But what&#8217;s done cannot be undone and if they all of a sudden started charging per minute at home, hell would break loose.</p>
<img src="http://feeds.feedburner.com/~r/WarriorPoint/~4/oUj5J52sym8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.warriorpoint.com/blog/2008/11/17/recession-proof-saas/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.warriorpoint.com/blog/2008/11/17/recession-proof-saas/</feedburner:origLink></item>
	</channel>
</rss>
