<?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:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>The League of Paul - Australian MSP</title>
	
	<link>http://www.theleagueofpaul.com/blog</link>
	<description />
	<lastBuildDate>Thu, 11 Mar 2010 12:03:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/TheLeagueOfPaul" /><feedburner:info uri="theleagueofpaul" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Android’s event design sucks</title>
		<link>http://feedproxy.google.com/~r/TheLeagueOfPaul/~3/MsMON4QgTZg/</link>
		<comments>http://www.theleagueofpaul.com/blog/2010/03/11/androids-event-design-sucks/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 11:59:50 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[CodeSnippet]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://www.theleagueofpaul.com/blog/2010/03/11/androids-event-design-sucks/</guid>
		<description><![CDATA[While delving further into Android, I&#8217;ve been creating a &#8220;hello world&#8221; type of app – its not as complex as what MahTweetsMobile will be, but it is encompassing a lot of different elements (custom ListAdapter, SQLite for persistent storage, different types of menus, loading external intents, etc).
One &#8220;difficult&#8221; element has been events. I say &#8220;difficult&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>While delving further into Android, I&#8217;ve been creating a &#8220;hello world&#8221; type of app – its not as complex as what MahTweetsMobile will be, but it is encompassing a lot of different elements (custom ListAdapter, SQLite for persistent storage, different types of menus, loading external intents, etc).</p>
<p>One &#8220;difficult&#8221; element has been events. I say &#8220;difficult&#8221; because by design, its freaking nuts.</p>
<h3>Scenario</h3>
<p>I&#8217;ve got a custom <em>ListViewAdapter</em>, for my custom list elements, where the <em>ListView</em> items include a checkbox. This checkbox is to indicate the status of the items (for reference, its a shopping list app, you tick the checkboxes to show which items you&#8217;ve bought while shopping, the items then go grey in colour).</p>
<p><img style="display: block; float: none; margin-left: auto; margin-right: auto; border: 0px;" title="device" src="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/03/device.png" border="0" alt="device" width="246" height="117" /></p>
<p>I wanted to add a &#8220;long press&#8221; context menu so that you could easily bring up a menu (with options such as Edit Item or Delete Item)</p>
<h3>The Problem</h3>
<p>Normally when &#8220;attaching&#8221; event listeners with <em>ListViews</em>, you use <em>setOnCreateContextMenuListener</em> on the <em>ListView</em> itself. You then override your Activity&#8217;s <em>onContextItemSelected</em>, figure out what menu button was pressed as well as what item it was pressed on.</p>
<blockquote>
<pre class="csharpcode">ListView x = (ListView)findViewById(R.id.ListView01);
x.setOnCreateContextMenuListener(<span class="kwrd">new</span> OnCreateContextMenuListener()
{
    <span class="kwrd">public</span> <span class="kwrd">void</span> onCreateContextMenu(ContextMenu contextMenu, View view,
ContextMenuInfo arg2)
    {
        contextMenu.add(0,CMENU_DELETE, 0, <span class="str">"Delete Item"</span>);
    }
});

<span class="kwrd">public</span> boolean onContextItemSelected(MenuItem item)
{
    AdapterContextMenuInfo menuInfo =
    (AdapterView.AdapterContextMenuInfo)item.getMenuInfo();
    <span class="kwrd">switch</span> (item.getItemId())
    {
        <span class="kwrd">case</span> CMENU_DELETE:
<span class="rem">//Use menuInfo.position along with the adapter.getItem</span>
<span class="rem">//ie Product p = (Product)adapter.getItem(menuInfo.position);</span>
            <span class="kwrd">return</span> <span class="kwrd">true</span>;
    }

    <span class="kwrd">return</span> <span class="kwrd">true</span>;
}</pre>
</blockquote>
<p>As you can see, its ugly code, but it works. Sort of. The problem was the checkboxes.</p>
<p>As soon as you add checkboxes to the individual items view, any listener created on the <em>ListView</em> never fires – the CheckBox swallows the event!</p>
<h3>The Apparent Solution</h3>
<p>Apparently this is a known bug (or more accurately, this is by design!). The solution is to set the event handlers on the rows themselves; inside the custom ListAdapter, when you&#8217;re inflating the various UI elements – <a href="http://www.theleagueofpaul.com/blog/2010/03/11/android-dev-custom-listadapter/">look at my previous post on Custom ListAdapter, it&#8217;s under the getView method</a> &#8211; on that &#8220;rowLayout&#8221; use the same <em>setOnCreateContextMenuListener</em> as the code used on ListView above, except <strong>only</strong> apply it to the individual row&#8217;s.</p>
<p>That would be fine if you didn&#8217;t care <em>which</em> item was pressed. That&#8217;s right, the cast to <em>AdapterContextMenuInfo </em>of <em>item.getMenuInfo()</em> in your Activity&#8217;s (<em>yes, your activity has to override this, nowhere else works. argh!)</em> <em>onContextItemSelected</em> always returns <em>null</em> because <em>item.getMenuInfo()</em> is always <em>null. </em></p>
<h3>The Actual Solution</h3>
<p>I have no idea how I stumbled across this solution – I think I was in the process of undo-ing lines of code to try and figure out &#8220;where I&#8217;d gone wrong&#8221;.</p>
<p><strong>Fact: </strong>To get the event to fire with checkboxes you <strong><em>need</em></strong> it to be set on the <em>rowLayout</em>.</p>
<p><strong>Fact: </strong>To get menuInfo to be anything other than null (ie, tell you where it came from), you need it set on the <em>ListView</em></p>
<p>Solution? Combine them. Wait, what? Two event listeners to get them to work? Yup.</p>
<p>On the <em>rowLayout</em>, set the listener:</p>
<blockquote>
<pre class="csharpcode">rowLayout.setOnCreateContextMenuListener(<span class="kwrd">new</span> OnCreateContextMenuListener()
{
    <span class="kwrd">public</span> <span class="kwrd">void</span> onCreateContextMenu(ContextMenu contextMenu, View view,

ContextMenuInfo arg2)
        {

        }
});</pre>
</blockquote>
<p>Notice the lack of code inside the <em>onCreateContextMenu</em>? Well, any <em>ContextMenu</em> items added inside this method won&#8217;t have <em>AdapterContextMenuInfo</em> – so don&#8217;t set anything, no menus will appear.</p>
<p>Now also set the adapter on the <em>ListView</em> using the code above.</p>
<p>Now it all works. WTF doesn&#8217;t begin to describe this.</p>
<img src="http://feeds.feedburner.com/~r/TheLeagueOfPaul/~4/MsMON4QgTZg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.theleagueofpaul.com/blog/2010/03/11/androids-event-design-sucks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.theleagueofpaul.com/blog/2010/03/11/androids-event-design-sucks/</feedburner:origLink></item>
		<item>
		<title>Android Dev: Custom ListAdapter</title>
		<link>http://feedproxy.google.com/~r/TheLeagueOfPaul/~3/rnyIyWq9DnQ/</link>
		<comments>http://www.theleagueofpaul.com/blog/2010/03/11/android-dev-custom-listadapter/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 11:27:10 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[CodeSnippet]]></category>

		<guid isPermaLink="false">http://www.theleagueofpaul.com/blog/2010/03/11/android-dev-custom-listadapter/</guid>
		<description><![CDATA[Disclaimer: This post presumes you&#8217;ve setup the Android SDK and Eclipse. If not, check out the Android Developer Guide
Some of the Android developer documents seem great, but in general there seems to be a lacking of documentation/examples – while the Java language is giving me no problems, how to do things with the Android API [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Disclaimer: This post presumes you&#8217;ve setup the Android SDK and Eclipse. If not, check out the <a href="http://developer.android.com/guide/developing/eclipse-adt.html">Android Developer Guide</a></strong></p>
<p>Some of the Android developer documents seem great, but in general there seems to be a lacking of documentation/examples – while the Java language is giving me no problems, how to do things with the Android API can be a bit of a nightmare to figure out.   </p>
<p> It is possibly because Android is relatively new or because I&#8217;m used to MSDN which is a fantastic resource. Regardless, I started to want to develop MahTweetsMobile for Android and was having difficulty in &#8216;binding&#8217; a &#8216;view&#8217; to a list of elements, ala WPF/XAML&#8217;s DataTemplates.</p>
<p>It turns out its not as magical as what WPF is and requires manual binding, but its not impossible.</p>
<h3>The View</h3>
<p>To get a list to display anything other than <em>just</em> a string, you need to define your own view in either XML or code-behind. I find XML to be a little nicer, and its easier to update.</p>
<p>In Eclipse (I&#8217;m sure it&#8217;ll work in other IDE&#8217;s too, but this is what I&#8217;m using), you can create a new view by navigating to <em>res –&gt; layout</em>, right clicking on the folder and selecting <em>New –&gt; Other, </em>then from the popup select <em>Android –&gt; Android XML File</em></p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/03/image.png" width="483" height="402" /> </p>
<p>Make sure in the next dialog you select the <em>Layout</em> resource type, and give the file a name like &quot;tweetview.xml&quot; (all in lower case, as java/ADK will complain otherwise). </p>
<blockquote><pre class="csharpcode"><span class="kwrd">&lt;?</span><span class="html">xml</span> <span class="attr">version</span><span class="kwrd">=&quot;1.0&quot;</span> <span class="attr">encoding</span><span class="kwrd">=&quot;utf-8&quot;</span>?<span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">LinearLayout</span>
<span class="attr">android:id</span><span class="kwrd">=&quot;@+id/widget32&quot;</span>
<span class="attr">android:layout_width</span><span class="kwrd">=&quot;fill_parent&quot;</span>
<span class="attr">android:layout_height</span><span class="kwrd">=&quot;fill_parent&quot;</span>
<span class="attr">android:orientation</span><span class="kwrd">=&quot;vertical&quot;</span>
<span class="attr">xmlns:android</span><span class="kwrd">=&quot;http://schemas.android.com/apk/res/android&quot;</span>
<span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">TableLayout</span>
<span class="attr">android:id</span><span class="kwrd">=&quot;@+id/widget33&quot;</span>
<span class="attr">android:layout_width</span><span class="kwrd">=&quot;wrap_content&quot;</span>
<span class="attr">android:layout_height</span><span class="kwrd">=&quot;wrap_content&quot;</span>
<span class="attr">android:orientation</span><span class="kwrd">=&quot;vertical&quot;</span>
<span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">TableRow</span>
<span class="attr">android:id</span><span class="kwrd">=&quot;@+id/widget35&quot;</span>
<span class="attr">android:layout_width</span><span class="kwrd">=&quot;fill_parent&quot;</span>
<span class="attr">android:layout_height</span><span class="kwrd">=&quot;wrap_content&quot;</span>
<span class="attr">android:orientation</span><span class="kwrd">=&quot;horizontal&quot;</span>
<span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">ImageButton</span>
<span class="attr">android:id</span><span class="kwrd">=&quot;@+id/imgbtnAvatar&quot;</span>
<span class="attr">android:layout_width</span><span class="kwrd">=&quot;wrap_content&quot;</span>
<span class="attr">android:layout_height</span><span class="kwrd">=&quot;wrap_content&quot;</span>
<span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">ImageButton</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">LinearLayout</span>
<span class="attr">android:id</span><span class="kwrd">=&quot;@+id/widget39&quot;</span>
<span class="attr">android:layout_width</span><span class="kwrd">=&quot;wrap_content&quot;</span>
<span class="attr">android:layout_height</span><span class="kwrd">=&quot;wrap_content&quot;</span>
<span class="attr">android:orientation</span><span class="kwrd">=&quot;vertical&quot;</span>
<span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">TextView</span>
<span class="attr">android:id</span><span class="kwrd">=&quot;@+id/txtName&quot;</span>
<span class="attr">android:layout_width</span><span class="kwrd">=&quot;wrap_content&quot;</span>
<span class="attr">android:layout_height</span><span class="kwrd">=&quot;wrap_content&quot;</span>
<span class="attr">android:text</span><span class="kwrd">=&quot;TextView&quot;</span>
<span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">TextView</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">TextView</span>
<span class="attr">android:id</span><span class="kwrd">=&quot;@+id/txtTweet&quot;</span>
<span class="attr">android:layout_width</span><span class="kwrd">=&quot;wrap_content&quot;</span>
<span class="attr">android:layout_height</span><span class="kwrd">=&quot;wrap_content&quot;</span>
<span class="attr">android:text</span><span class="kwrd">=&quot;TextView&quot;</span>
<span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">TextView</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">LinearLayout</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">TableRow</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">TableLayout</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">LinearLayout</span><span class="kwrd">&gt;</span></pre>
</blockquote>
<h3>The Model</h3>
<p>Just a simple class to hold our data, </p>
<blockquote>
<pre class="csharpcode">package mahapps.MahTweets;

import java.util.Date;

<span class="kwrd">public</span> <span class="kwrd">class</span> Tweet {
    <span class="kwrd">public</span> <span class="kwrd">int</span> ID;
    <span class="kwrd">public</span> String Name;
    <span class="kwrd">public</span> String Text;
    <span class="kwrd">public</span> Date Timestamp;

    <span class="kwrd">public</span> <span class="kwrd">int</span> getID()
    {
        <span class="kwrd">return</span> <span class="kwrd">this</span>.ID;
    }

    <span class="kwrd">public</span> String getName()
    {
        <span class="kwrd">return</span> <span class="kwrd">this</span>.Name;
    }

    <span class="kwrd">public</span> String getText()
    {
        <span class="kwrd">return</span> <span class="kwrd">this</span>.Text;
    }

    <span class="kwrd">public</span> Tweet()
    {

    }
}</pre>
</blockquote>
<h3>The Custom ListAdapter</h3>
<p>This is the &quot;heavy lifting&quot; code – this is what &quot;binds&quot; a Tweet object to the TweetView.</p>
<blockquote>
<pre class="csharpcode">package mahapps.MahTweets;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.*;
import java.util.*;

<span class="kwrd">public</span> <span class="kwrd">class</span> TweetAdapter extends BaseAdapter
{
    <span class="kwrd">private</span> List&lt;Tweet&gt; elements;
    <span class="kwrd">private</span> Context c;

    <span class="kwrd">public</span> TweetAdapter(Context c, List&lt;Tweet&gt; Tweets)
    {
        <span class="kwrd">this</span>.elements = Tweets;
        <span class="kwrd">this</span>.c = c;
    }
    <span class="kwrd">public</span> <span class="kwrd">int</span> getCount() {

        <span class="kwrd">return</span> elements.size();
    }

    <span class="kwrd">public</span> Object getItem(<span class="kwrd">int</span> position) {

        <span class="kwrd">return</span> elements.get(position);
    }

    <span class="kwrd">public</span> <span class="kwrd">long</span> getItemId(<span class="kwrd">int</span> id) {

        <span class="kwrd">return</span> id;
    }

    <span class="kwrd">public</span> <span class="kwrd">void</span> Remove(<span class="kwrd">int</span> id)
    {
        notifyDataSetChanged();
    }
    <span class="kwrd">public</span> View getView(<span class="kwrd">int</span> position, View convertView, ViewGroup parent)
    {

        LinearLayout rowLayout;
        Tweet t = elements.get(position);

        <span class="kwrd">if</span> (convertView == <span class="kwrd">null</span>)
        {
            rowLayout = (LinearLayout)LayoutInflater.from(c).inflate
                      (R.layout.TweetListView, parent, <span class="kwrd">false</span>);
           TextView tv = (TextView)rowLayout.findViewById(R.id.txtName);
           tv.setText(t.getText());

           <span class="rem">//...</span>
           <span class="rem">//and so on for all the properties/UI elements</span>
           <span class="rem">//...</span>

        } <span class="kwrd">else</span> {
            rowLayout = (RelativeLayout)convertView;
        }
        <span class="kwrd">return</span> rowLayout;
    }
}</pre>
</blockquote>
<p>&#160;</p>
<p>You can then use this in your main Activity:</p>
<blockquote>
<pre class="csharpcode">ListView x = (ListView)findViewById(R.id.ListView01);
x.setAdapter(<span class="kwrd">new</span> TweetAdapter(<span class="kwrd">this</span>, MyListOfTweets));</pre>
</blockquote>
<p>If you&#8217;re using a ListActivity, you&#8217;d just set that Activity&#8217;s adapter. </p>
<p>Your ListView items should then appear in more detail!</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/03/image1.png" width="328" height="71" /></p>
<img src="http://feeds.feedburner.com/~r/TheLeagueOfPaul/~4/rnyIyWq9DnQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.theleagueofpaul.com/blog/2010/03/11/android-dev-custom-listadapter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.theleagueofpaul.com/blog/2010/03/11/android-dev-custom-listadapter/</feedburner:origLink></item>
		<item>
		<title>Geosense For Windows for devs</title>
		<link>http://feedproxy.google.com/~r/TheLeagueOfPaul/~3/DHEu46z_wzs/</link>
		<comments>http://www.theleagueofpaul.com/blog/2010/03/01/geosense-for-windows-for-devs/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 06:41:06 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[CodeSnippet]]></category>
		<category><![CDATA[geosense]]></category>
		<category><![CDATA[MahTweets]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false">http://www.theleagueofpaul.com/blog/2010/03/01/geosense-for-windows-for-devs/</guid>
		<description><![CDATA[ 
Now that Rafael Rivera and Long Zheng have launched Geosense For Windows (or you can see Long&#8217;s post on it), I can happily brag how MahTweets has supported this since before they started working on it.
Geosense and MahTweets both use the Windows 7 Location and Sensor Platform – Geosense being the provider, MahTweet being [...]]]></description>
			<content:encoded><![CDATA[<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="logo" border="0" alt="logo" src="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/03/logo.png" width="380" height="72" /> </p>
<p>Now that <a href="http://withinwindows.com">Rafael Rivera</a> and <a href="http://istartedsomething.com">Long Zheng</a> have launched <em><strong><a href="http://www.geosenseforwindows.com/">Geosense For Windows</a> </strong>(or you can see <a href="http://www.istartedsomething.com/20100301/geosense-for-windows-location-released/">Long&#8217;s post</a> on it)</em>, I can happily brag how <a href="http://www.mahtweets.com">MahTweets</a> has supported this since before they started working on it.</p>
<p>Geosense and MahTweets both use the <em>Windows 7 Location and Sensor Platform</em> – Geosense being the provider, MahTweet being the consumer. We supported it in MahTweets to geotag tweets and Flickr photos, in the hope that one day Microsoft or the hardware partners would be kind enough to consider Australia a real country and finally release some relevant hardware to the platform here. So far that hasn&#8217;t happened, which is where Geosense steps in.</p>
<h3>Geosense with .NET</h3>
<p>Geosense by itself doesn&#8217;t really do anything terribly exciting to the end user &#8211; it&#8217;s what Geosense enables for developers that is awesome. Location based services and games are primarily on phones only as it can be a hassle for the user to manually enter their location all the time – now it&#8217;s dead easy to bring those services and games to the desktop through rich clients.    </p>
<p>To start with, grab the <a href="http://code.msdn.microsoft.com/SensorsAndLocation/Release/ProjectReleases.aspx?ReleaseId=2359">Sensor and Location .NET Interop Sample Library</a>.</p>
<p>Below is an abridged version of the MahTweets GlobalPosition class file (it does some other stuff for other platforms that don&#8217;t have the sensor API&#8217;s, but that&#8217;s just a matter of people manually setting their location).</p>
<pre class="csharpcode"><span class="kwrd">using</span> Windows7.Location;</pre>
<style type="text/css">
<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; }</style>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">class</span> Location
{
    <span class="kwrd">public</span> String City { get; set; }
    <span class="kwrd">public</span> String Country { get; set; }
    <span class="kwrd">public</span> <span class="kwrd">double</span> Latitude { get; set; }
    <span class="kwrd">public</span> <span class="kwrd">double</span> Longitude { get; set; }
}

<span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">class</span> GlobalPosition
{
    <span class="kwrd">private</span> <span class="kwrd">static</span> LatLongLocationProvider _provider;
    <span class="kwrd">private</span> <span class="kwrd">static</span> CivicAddressLocationProvider _civicprovider;
    <span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">bool</span> _loadproviderthrowsexception = <span class="kwrd">false</span>;
    <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">uint</span> DEFAULT_REPORT_INTERVAL = 0;

    <span class="kwrd">public</span> <span class="kwrd">static</span> Location GetLocation()
    {
        Location l = <span class="kwrd">new</span> Location();

        <span class="kwrd">try</span>
        {
            <span class="kwrd">if</span> (_loadproviderthrowsexception)
            {
                <span class="kwrd">return</span> <span class="kwrd">null</span>;
            }

            <span class="kwrd">if</span> (_provider == <span class="kwrd">null</span>)
            {
                _provider = <span class="kwrd">new</span> LatLongLocationProvider(DEFAULT_REPORT_INTERVAL);
                _civicprovider = <span class="kwrd">new</span> CivicAddressLocationProvider(DEFAULT_REPORT_INTERVAL);
            }
            var y = _civicprovider.GetReport() <span class="kwrd">as</span> CivicAddressLocationReport;

            l.City = y.City;
            l.Country = y.CountryOrRegion;

            var x = _provider.GetReport() <span class="kwrd">as</span> LatLongLocationReport;
            l.Latitude = x.Latitude;
            l.Longitude = x.Longitude;
            <span class="kwrd">return</span> l;
        }
        <span class="kwrd">catch</span> (Exception ex)
        {
            <span class="kwrd">return</span> <span class="kwrd">null</span>;
        }

    }
}</pre>
<style type="text/css">
<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; }</style>
<style type="text/css">
<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; }</style>
</p>
<p>Easy. The code speaks for itself – create a LocationProvider, query it to get the Latitude/Longitude. The rest is up to you.</p>
<h3></h3>
<h3>Bonus Points</h3>
<p>And if you&#8217;re a Powershell junkie, the following works too</p>
<pre class="csharpcode">[Reflection.Assembly]::LoadFile(<span class="str">&quot;&lt;absolute location to dll&gt;\Windows7.SensorAndLocation.dll&quot;</span>)
$provider = <span class="kwrd">new</span>-<span class="kwrd">object</span> Windows7.Location.LatLongLocationProvider(0)
$position = $provider.GetReport()
$position.Latitude
$position.Longitude</pre>
<style type="text/css">
<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; }</style>
<img src="http://feeds.feedburner.com/~r/TheLeagueOfPaul/~4/DHEu46z_wzs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.theleagueofpaul.com/blog/2010/03/01/geosense-for-windows-for-devs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.theleagueofpaul.com/blog/2010/03/01/geosense-for-windows-for-devs/</feedburner:origLink></item>
		<item>
		<title>Android: ListView Divider</title>
		<link>http://feedproxy.google.com/~r/TheLeagueOfPaul/~3/s55B78hm024/</link>
		<comments>http://www.theleagueofpaul.com/blog/2010/02/26/android-listview-divider/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 09:07:46 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[CodeSnippet]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://www.theleagueofpaul.com/blog/2010/02/26/android-listview-divider/</guid>
		<description><![CDATA[Disclaimer: I&#8217;m new to Android, I could be doing this all wrong. If I am, please comment and correct me.
Programming for Android is an interesting experience, coming from a .NET/C# background. I&#8217;ve done plenty of Java before in Uni and disliked it, but that was before I started playing with WPF. 
Like WPF, Android&#8217;s UI [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Disclaimer: I&#8217;m new to Android, I could be doing this all wrong. If I am, please comment and correct me.</strong></p>
<p>Programming for Android is an interesting experience, coming from a .NET/C# background. I&#8217;ve done plenty of Java before in Uni and disliked it, but that was <em>before</em> I started playing with WPF. </p>
<p>Like WPF, Android&#8217;s UI is created using XML based documents, but unlike WPF, there aren&#8217;t any nice WYSIWYG builders. And most of the time it seems you need a combination of code behind and XML to get what you want for the UI, which can get a bit frustrating. </p>
<p><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="device_border" border="0" alt="device_border" src="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/02/device_border.png" width="321" height="286" /> </p>
<p>The divider between the items in this particular app is more annoying than it is useful, so I wanted to get rid of it. I was initially looking for <em>separator </em>or <em>border, </em>but the name is <em>divider</em>, and it has two properties<em>.</em>To set the divider between the ListItems to &quot;nothing&quot;, you have two options. The first is in Java, </p>
<pre class="csharpcode">ListView x = (ListView)findViewById(R.id.ListView01);
x.setDivider(<span class="kwrd">null</span>);
x.setDividerHeight(0);</pre>
<p>The alternative is to set it in XML, but in this case its more of a hack than the above of turning it &#8216;off&#8217;.<br />
  </p>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">ListView</span>
<span class="attr">android:id</span><span class="kwrd">=&quot;@+id/ListView01&quot;</span>
<span class="attr">android:background</span><span class="kwrd">=&quot;#ffffff&quot;</span>
<span class="attr">android:dividerHeight</span><span class="kwrd">=&quot;0px&quot;</span>
<span class="attr">android:divider</span><span class="kwrd">=&quot;#ffffff&quot;</span> <span class="kwrd">/&gt;</span></pre>
<p><span class="kwrd">Even though the dividerHeight is set to 0 (0px, 0dp, whatever, the results were the same), a black line was still visible. The best solution is to set the colour (the divider value) to the same as your background. Using a gradient or image as the background? Set it in the code behind.</span></p>
<style type="text/css">
<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; }</style>
<style type="text/css">
<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; }</style>
<p><a href="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/02/device_noborder.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="device_noborder" border="0" alt="device_noborder" src="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/02/device_noborder_thumb.png" width="345" height="266" /></a></p>
<img src="http://feeds.feedburner.com/~r/TheLeagueOfPaul/~4/s55B78hm024" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.theleagueofpaul.com/blog/2010/02/26/android-listview-divider/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.theleagueofpaul.com/blog/2010/02/26/android-listview-divider/</feedburner:origLink></item>
		<item>
		<title>Sour side of Android/Google ID</title>
		<link>http://feedproxy.google.com/~r/TheLeagueOfPaul/~3/I6Wf3beOUDo/</link>
		<comments>http://www.theleagueofpaul.com/blog/2010/02/25/sour-side-of-androidgoogle-id/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 03:06:26 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[fail]]></category>

		<guid isPermaLink="false">http://www.theleagueofpaul.com/blog/2010/02/25/sour-side-of-androidgoogle-id/</guid>
		<description><![CDATA[Google products and services range from &#8216;awesome&#8217; down to &#8216;wtf&#8217; (*cough*Orkut*cough*), and their single signon/identification system (&#34;Google Account&#34;) sits somewhere between the two.
On Android, just about everything is tied to a Google account. No big deal, I use Google Apps 4 Domains (GAFD) and I&#8217;ve used an email address associated with that to create a [...]]]></description>
			<content:encoded><![CDATA[<p>Google products and services range from &#8216;awesome&#8217; down to &#8216;wtf&#8217; (*cough*Orkut*cough*), and their single signon/identification system (&quot;Google Account&quot;) sits somewhere between the two.</p>
<p>On Android, just about everything is tied to a Google account. No big deal, I use <a href="http://www.google.com/apps/intl/en/group/index.html">Google Apps 4 Domains</a> (GAFD) and I&#8217;ve used an email address associated with that to create a GoogleID which I use for Google Reader and other products. </p>
<p>To be honest, I was a little confused initially when the newly created GAFD account didn&#8217;t also create a GoogleID, but no big deal, I created my own. As far as I know, everything has worked – I even have a Google Checkout account. Even on the Android everything was working great, syncing contacts/email/calendar/etc, all was swell &#8211; until it got to the Market.    </p>
<p><strong>Using a GAFD based GoogleID&#160; doesn&#8217;t let you purchase apps. </strong>You can see the &#8216;buy&#8217; button, but when you go to buy, it&#8217;ll go through an infinite loop of asking for a Google Account. </p>
<p>Midway through <strong>2009, </strong>a Google employee responded to a <a href="http://www.google.com/support/forum/p/Android+Market/thread?tid=5be7ec2291114a13&amp;hl=en">help thread</a></p>
<blockquote><p>At the moment, Google Apps accounts may not be used for Google Checkout transactions, so Android Market requires the additional login to a Gmail account that is used for payments. However, this doesn&#8217;t mean that users will need to wipe their phones. The rest of the phone itself is still tied to the primary account that was signed in at start-up; in your case, the Google Apps account. </p>
</blockquote>
<p>They acknowledge the problem, and surely would have fixed it by now in 2010, <a href="http://www.google.com/support/forum/p/Android+Market/thread?tid=04f2d264ac507b8e&amp;hl=en">right?</a> Wrong. The user in that particular thread bought a Nexus One through his GAFD based account with Google Checkout, so it&#8217;s good enough to buy a phone, but not a $0.99 app? Great.</p>
<blockquote><p>Sorry to hear you&#8217;re having trouble purchasing apps. It sounds as if you&#8217;re logged in with a Google Apps account. When prompted to enter the Checkout account, please be sure to enter a non-Google Apps account to ensure that the purchases can go through. Let us know if you&#8217;re had success purchasing since your post.</p>
</blockquote>
<p>Hopefully this will help somebody else, but the <strong>only solution is to also add a @Gmail account. </strong>And even then, you better hope your carrier doesn&#8217;t block App purchases (like say.. Optus do)</p>
<img src="http://feeds.feedburner.com/~r/TheLeagueOfPaul/~4/I6Wf3beOUDo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.theleagueofpaul.com/blog/2010/02/25/sour-side-of-androidgoogle-id/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.theleagueofpaul.com/blog/2010/02/25/sour-side-of-androidgoogle-id/</feedburner:origLink></item>
		<item>
		<title>Hello, Milestone</title>
		<link>http://feedproxy.google.com/~r/TheLeagueOfPaul/~3/oEaQga01Vr4/</link>
		<comments>http://www.theleagueofpaul.com/blog/2010/02/22/hello-milestone/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 05:04:01 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Milestone]]></category>

		<guid isPermaLink="false">http://www.theleagueofpaul.com/blog/2010/02/22/hello-milestone/</guid>
		<description><![CDATA[Again, thanks to Will I’m now on my second Android phone, this time the flagship Android phone from Motorola – the Milestone (the GSM version of the Droid).
The quality of the photos of the device are a little so so – I&#8217;m fighting off sinusitis and bronchitis at the moment, so I just don&#8217;t care.
&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Again, thanks to Will I’m now on my second Android phone, this time the flagship Android phone from Motorola – <a href="http://en.wikipedia.org/wiki/Motorola_Droid">the Milestone</a> (the GSM version of the Droid).</p>
<p>The quality of the photos of the device are a little so so – I&#8217;m fighting off sinusitis and bronchitis at the moment, so I just don&#8217;t care.</p>
<p><a href="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/02/IMG_4377.jpg"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="IMG_4377" border="0" alt="IMG_4377" src="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/02/IMG_4377_thumb.jpg" width="643" height="430" /></a>&#160; </p>
<h3>The Good</h3>
<p>I think the design is one of those &quot;love or hate&quot; designs – it has rather striking straight lights and &quot;sharp&quot; corners, unlike most phones these days. It&#8217;s weightier than it probably needs to be, but that gives it an incredibly solid feel to it.    </p>
<p>There is a lot to like about this phone, however there are two stand out features (for me)</p>
<ul>
<li><strong>I feel the need, the need for..        <br /></strong>Speed. This thing is fast. The difference between the speed of this phone and all others I&#8217;ve had/used before is impressive. While ~50mhz slower than the iPhone, or ~450mhz slower than the Nexus One&#8217;s 1ghz Snapdragon processor, the Milestone has a dedicated GPU. It gets shit done.       </p>
</li>
<li><strong>The Screen        <br /></strong>The screen specs are 3.7&quot;, 854 x 480px, TFT LCD, 16M colours.
<p>Yes, it drains the battery, but damn it looks good. I was a little concerned thinking that all the text would be tiny compared to the Dream (480 x 320 – same as the iPhone), but for the most part it just makes text so much clearer and easier to read.       </p>
<p><a href="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/02/IMG_4376.jpg"><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="IMG_4376" border="0" alt="IMG_4376" src="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/02/IMG_4376_thumb.jpg" width="623" height="337" /></a>&#160; </p>
<p>Apparently the Nexus One screen (which has the slightly lower resolution of 800 x 480) is even better than the Milestone, which is scary awesome. </li>
</ul>
<h3>The Bad</h3>
<p>Not everything is perfect on the Milestone, however. These complaints however, are (mostly) me nitpicking as much as possible.</p>
<ul>
<li><strong>The Keyboard        <br /></strong>See below in the comparison against the Dream for details, but the keyboard sucks. Still better than onscreen however.       </p>
</li>
<li><strong>MicroSD Slot        <br /></strong>The MicroSD slot is unfortunately impossible to get to without removing the battery. This is annoying because it somewhat defeats the obvious argument against internal-only storage of <em>&quot;you can have multiple SD cards and change whenever you like&quot;
<p></em></li>
<li><strong>The Camera        <br /></strong>Don&#8217;t get me wrong, a 5mpx + Dual LED flash is neat. It takes good enough photos and video. For the sensor the size it is, 5mpx is overkill and creates some extra ISO noise but again, the photo quality is <em>good enough</em>.
<p>The problem I have with the (still) camera is the desire to use the flash in every situation – that is, every time I&#8217;ve tried to take a photo, it&#8217;ll use the flash if &#8216;auto-flash&#8217; is enabled.       </p>
<p>Below, on the left is flash disabled, and on the right with auto-flash enabled. The irony is is, apart from the shot <em>without</em> the flash having better/more accurate colours, the flash actually make the image blur! </li>
</ul>
<p><a href="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/02/2010022215.05.23.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="2010-02-22 15.05.23" border="0" alt="2010-02-22 15.05.23" src="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/02/2010022215.05.23_thumb.jpg" width="342" height="257" /></a><a href="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/02/2010022215.04.57.jpg"><img style="border-right-width: 0px; margin: 0px 0px 0px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="2010-02-22 15.04.57" border="0" alt="2010-02-22 15.04.57" src="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/02/2010022215.04.57_thumb.jpg" width="343" height="257" /></a>&#160;</p>
<h3>Against the HTC Dream</h3>
<p>The obvious comparison for me is between the Dream and Milestone, but mostly it should be considered an unfair comparison. For starters, the Dream was released in October 2008 whereas the Droid/Milestone in November 2009, and while the G1 wasn’t considered the lowest end in its day, it was never a real &quot;premium&quot; phone, which the Milestone clearly is.</p>
<p>Specification wise, nearly everything is better – faster CPU, higher res screen, more onboard flash, better camera, better Bluetooth support, the list goes on. However it is interesting to note that the Milestone doesn’t win in <em>all </em>categories.</p>
<p><strong>Keyboard      <br /></strong>Like the Dream, the Milestone is a slider with a qwerty keyboard. However unlike the Dream, the Milestones keys don’t have a gap between each key, are far flatter, and have less &quot;travel&quot;.     <br />The key advantage physical keyboards have over onscreen keyboards is the tactile response, whether it is being able to tell where one key ends/starts because of the key separation or by having to push the key down (rather than float over it).</p>
<p><a href="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/02/IMG_4380.jpg"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="IMG_4380" border="0" alt="IMG_4380" src="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/02/IMG_4380_thumb.jpg" width="488" height="327" /></a></p>
<p>Apart from the less than ideal keys, the keyboard layout itself is a little funny. Instead of a five row key layout, they’ve gone for four which results in requiring alt to be pressed to enter a number. Although not as big a problem as the keys themselves, it is still a little frustrating.</p>
<p>Without a doubt, the Dream’s keyboard is just simply <em>better</em>. </p>
<p>It is interesting that the lower end <a href="http://www.engadget.com/2010/02/20/motorola-devours-seven-minutes-of-your-life-with-a-phone-demo-v/">Motorola Devour</a> coming out seems to have a far better keyboard (Motorola promoting the raised keys)</p>
<p><strong>Hardware Buttons      <br /></strong>While the Milestone is not devoid of hardware buttons, Motorola’s choice of input is a little… lacking? Two (fairly standard) buttons are missing (&quot;accept call&quot; and &quot;end call&quot;), and unlike the Dream (and many Blackberrys) the scroller is gone in favour of a D-Pad which is hidden unless you slide out the keyboard.</p>
<p><strong>Build Quality      <br /></strong>There is no comparison here, and this is part of what I meant by the Dream not being a premium phone – the Milestone is just so solidly built with far better finish. The best example I can think of is the sliding mechanism – on the Dream it&#8217;ll rattle if the phone vibrates (call/notification/etc), whereas the Milestone is just solid.</p>
<h3>Android 2.x</h3>
<p>Apart from neat hardware, the other thing that the Milestone is rocking is Android 2.0.1, and what a difference it makes. Apart from everything seeming so much smoother and faster, Exchange support is built in! There are lots of improvements, but to be honest, I&#8217;ve barely scratched the surface of Android 1.6 let alone 2.0!</p>
<p><a href="http://developer.android.com/sdk/android-2.0-highlights.html">Google have a fairly detailed list of highlights for Android 2.0</a></p>
</p>
</p>
</p>
</p>
</p>
</p>
</p>
</p>
<p>I think the Contacts API is interesting, it allows multiple data stores for a single contact, so you could sync Facebook contacts to Gmail contacts. The Facebook app doesn&#8217;t work 100% for the Milestone (does for Droid/Nexus One) just yet, but it looks interesting. As does the possibility of extending this with Twitter/MahTweets Mobile.</p>
<img src="http://feeds.feedburner.com/~r/TheLeagueOfPaul/~4/oEaQga01Vr4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.theleagueofpaul.com/blog/2010/02/22/hello-milestone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.theleagueofpaul.com/blog/2010/02/22/hello-milestone/</feedburner:origLink></item>
		<item>
		<title>Android Convert</title>
		<link>http://feedproxy.google.com/~r/TheLeagueOfPaul/~3/JCcdeseQETk/</link>
		<comments>http://www.theleagueofpaul.com/blog/2010/01/19/android-convert/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 04:15:51 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ADP1]]></category>
		<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://www.theleagueofpaul.com/blog/2010/01/19/android-convert/</guid>
		<description><![CDATA[Thanks to Will, I&#8217;ve now got an Android phone. The HTC Dream/Android Developer Phone 1 to be exact.

I&#8217;ve had my HTC p3600i for almost two years now; I wrote that review not long after I bought the device, and it wasn&#8217;t long after it that the flaws started to show. As I did mention, browsing [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to <a href="http://will.hughesfamily.net.au">Will</a>, I&#8217;ve now got an Android phone. The HTC Dream/Android Developer Phone 1 to be exact.</p>
<p><a href="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/01/IMG_4237.jpg"><img style="display: block; float: none; margin-left: auto; margin-right: auto; border: 0px;" title="IMG_4237" src="http://www.theleagueofpaul.com/blog/wp-content/uploads/2010/01/IMG_4237_thumb.jpg" border="0" alt="IMG_4237" width="477" height="342" /></a></p>
<p>I&#8217;ve had my <a href="http://www.aeoth.net/blog/2008/05/29/htc-p3600iwindows-mobile-6-review/">HTC p3600i</a> for almost two years now; I wrote that review not long after I bought the device, and it wasn&#8217;t long after it that the flaws started to show. As I did mention, browsing was useless with PocketIE, but over time the device just became less and less stable. In the last two or three months, the phone has insisted that its roaming unless I reboot it – then it&#8217;ll work for about 15-20minutes.</p>
<p>The developer experience for Windows Mobile 6.0 (and presumably 6.1 &amp; 6.5) was also a nightmare. I once started looking at creating a Twitter client for it, and I discovered that to get TextWrapping on a TextBox (under .NET CF), you had to override the Draw method of the Textbox. Already I&#8217;ve created more for Android than I did for Windows Mobile, and it&#8217;s still at the proof of concept stage! (More on that in a later post)</p>
<p>I&#8217;m really enjoying the relative responsiveness of the Dream/Android, as well as much nicer UI. Having a physical keyboard again is <em>awesome</em>, I don&#8217;t think I could go back to an all touchscreen phone. A usable browser is also a nice change – I can finally do net banking on my phone, should I need to.</p>
<p>That&#8217;s not to say Android or the Dream are flawless.</p>
<ul>
<li>Battery life sucks,<br />&nbsp;</li>
<li>I&#8217;ve had more than a fair share of various parts of Android (such as the Home screen) lock up,<br />&nbsp;</li>
<li>Android 1.6 has no Exchange support (although this is in 2/2.1, it&#8217;ll be awhile – if ever &#8211; before the Dream gets the upgrade because of <strike>the relatively small partition for the OS</strike> not enough RAM &#8211; thanks for the clarification <a href="http://twitter.com/bck/status/7932915600">Bck</a>),<br />&nbsp;</li>
<li>Many applications (including the &#8220;Google Experience&#8221; apps) default to notifications/always running/syncing requiring disabling the settings.Gmail, despite turned off under <em>Settings –&gt; Data Synchronisation –&gt; Auto-sync</em> (and <em>Auto-sync</em> turned off completely) always seems to sync as soon as <em>Background Data</em> is enabled, so I have to leave that off, which then disables the Market!Disabling <em>Background Data </em>warns/informs that disabling it will save power and data, but some applications require it <strong><em>and still use the connection</em></strong>!<br />&nbsp;</li>
<li>While the UI is pretty good, a lot of it is incredibly unintuitive. Some of the submenus in Settings have additional menu (activated by pressing the Menu button), but there is no visual indicator nor do all of the submenus respond to it.</li>
</ul>
<img src="http://feeds.feedburner.com/~r/TheLeagueOfPaul/~4/JCcdeseQETk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.theleagueofpaul.com/blog/2010/01/19/android-convert/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.theleagueofpaul.com/blog/2010/01/19/android-convert/</feedburner:origLink></item>
		<item>
		<title>MahTweets: Columns not saving?</title>
		<link>http://feedproxy.google.com/~r/TheLeagueOfPaul/~3/TYKPSViquhI/</link>
		<comments>http://www.theleagueofpaul.com/blog/2010/01/19/mahtweets-columns-not-saving/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 02:08:13 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[MahTweets]]></category>

		<guid isPermaLink="false">http://www.theleagueofpaul.com/blog/2010/01/19/mahtweets-columns-not-saving/</guid>
		<description><![CDATA[With each new version of MahTweets – even the sub-releases – many people are having columns not saving correctly.
Disclaimer: This is entirely my fault.
The Fix
Long story cut short, the quickest way to fix this is to delete all of your columns, recreate them, and then quit. They should then reappear on next launch.
If that doesn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>With each new version of MahTweets – even the sub-releases – many people are having columns not saving correctly.</p>
<p><strong>Disclaimer: This is entirely <em>my</em> fault.</strong></p>
<h3>The Fix</h3>
<p>Long story cut short, the quickest way to fix this is to delete all of your columns, recreate them, and then quit. They should then reappear on next launch.</p>
<p>If that doesn&#8217;t work, you <em>can</em> remove all of your accounts, columns, etc, and start from scratch, but it could give the same problem. The best way would be to delete your config file and start from scratch. That can <strong>currently</strong> be found in</p>
<blockquote><p>C:\Users\&lt;YourUserName&gt;\AppData\Local\Apps\2.0\Data\&lt;SomeHash&gt;\&lt;AnotherHash&gt;\<br />maht..tion_&lt;YetAnotherHash&gt;\Data\2.7.4.529</p></blockquote>
<p>Mine is</p>
<blockquote><p>C:\Users\Paul\AppData\Local\Apps\2.0\Data\5B03WGLL.0H0\ODJ8MMQ8.3WX\<br />maht..tion_0000000000000000_0002.0007_342b7e02bb86691e\Data\2.7.4.529</p></blockquote>
<p>Delete the <em>user.config</em> file and it should be fine until the next update. It&#8217;s not ideal, I know, but we are working on a solution, which will also result in the config file being moved to another location.</p>
<h3>The Explanation</h3>
<p>We know what the problem is, sort of. Columns are made up of many &#8220;UpdateTypes&#8221;, such as &#8220;Normal&#8221;, &#8220;Mentions&#8221;, &#8220;Direct Messages&#8221;. Every one you have selected is written to the settings file on close, under Filters (Filters –&gt; FilterList –&gt; StreamList –&gt; FilterStream). Below is an example</p>
<pre class="csharpcode">&lt;FilterStream&gt;
    &lt;IsIncluded&gt;Include&lt;/IsIncluded&gt;
    &lt;Protocol&gt;statusnet&lt;/Protocol&gt;
    &lt;AccountName&gt;aeoth&lt;/AccountName&gt;
    &lt;Color&gt;
        &lt;A&gt;0&lt;/A&gt;
        &lt;R&gt;0&lt;/R&gt;
        &lt;G&gt;0&lt;/G&gt;
        &lt;B&gt;0&lt;/B&gt;
        &lt;ScA&gt;0&lt;/ScA&gt;
        &lt;ScR&gt;0&lt;/ScR&gt;
        &lt;ScG&gt;0&lt;/ScG&gt;
        &lt;ScB&gt;0&lt;/ScB&gt;
    &lt;/Color&gt;
    &lt;UpdateTypeString&gt;MahTweets2.IdenticaPlugin.MentionUpdate, MahTweets2.IdenticaPlugin,
<strong>Version=1.0.0.0</strong>, Culture=neutral, PublicKeyToken=<span class="kwrd">null</span>&lt;/UpdateTypeString&gt;
&lt;/FilterStream&gt;</pre>
<p>Although it&#8217;s a little hard to see, I&#8217;ve placed emphasis on the Version number. With each new version, that changes, so currently it will have 2.7.4.529 (for those playing at home, 529 is the Subversion commit number associated with that release). However, if you&#8217;ve upgraded from 2.7.3, MahTweets will go looking for that version, and isn&#8217;t able to find it.</p>
<p>As I&#8217;ve said, we are working on a solution, but its not here just yet.</p>
<img src="http://feeds.feedburner.com/~r/TheLeagueOfPaul/~4/TYKPSViquhI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.theleagueofpaul.com/blog/2010/01/19/mahtweets-columns-not-saving/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.theleagueofpaul.com/blog/2010/01/19/mahtweets-columns-not-saving/</feedburner:origLink></item>
		<item>
		<title>MahTweets 2.7 Released!</title>
		<link>http://feedproxy.google.com/~r/TheLeagueOfPaul/~3/xRjlKG6FBY8/</link>
		<comments>http://www.theleagueofpaul.com/blog/2010/01/16/mahtweets-2-7-released/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 03:53:28 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[MahTweets]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://www.theleagueofpaul.com/blog/2010/01/16/mahtweets-2-7-released/</guid>
		<description><![CDATA[On Wednesday night, we pushed out another version of MahTweets, version 2.7. It’s been a long time between releases (3 months!) but a huge amount of work has gone into it.
New Features

Autocomplete Everywhere        In previous versions we didn&#8217;t have autocomplete for contact names. Now we do. And its [...]]]></description>
			<content:encoded><![CDATA[<p>On Wednesday night, we pushed out another version of MahTweets, version 2.7. It’s been a long time between releases (3 months!) but a huge amount of work has gone into it.</p>
<h3>New Features</h3>
<ul>
<li><strong>Autocomplete Everywhere        <br /></strong>In previous versions we didn&#8217;t have autocomplete for contact names. Now we do. And its everywhere you can type!<strong>        <br /></strong></li>
<li><strong>Yammer Plugin        <br /></strong>Fairly basic at the moment, but we will get it up to &quot;Twitter level&quot; of support in the next version. Currently you can view/send and downloading attachments.       </li>
<li><strong>Plurk Plugin
<p></strong></li>
<li><strong>Ping.fm Plugin        <br /></strong>No media &#8216;pings&#8217; yet, but that&#8217;ll come soon – still beat Seesmic to it! ;)       </li>
<li><strong>Bit.ly Plugin        <br /></strong>We couldn&#8217;t support bit.ly in previous versions due to how IUrlShortener plugins worked, but now they can store credentials much like any other plugin.       </li>
<li><strong>Geotagging for Flickr &amp; Twitter</strong> (both viewing and sending geotagged tweets)       </li>
<li><strong>Searching</strong>       <br />We now have the ISearchProvider interface, which lets IMicroblogs (aka, connection plugins like Twitter) provide a way to search.
<p>At the moment went have &quot;regular&quot; Twitter search and <em>streaming</em> Twitter search. Although not entirely certain, I&#8217;m fairly confident to say we&#8217;re the first or one of the first full feature Twitter clients with streaming search support!       </p>
<p>Streaming search maintains a constant connection to twitter, but you get results in <em>real time</em>. How fast? In most tests, you get the tweet roughly the same time it appears in the web interface for the person tweeting!       </p>
<p>Down the track we’ll be adding Yammer and Plurk ISearchProviders, perhaps even Facebook.       </li>
<li><strong>Local Searching        <br /></strong></li>
<li><strong>Read/Unread tracking        <br /></strong>This is optional, but you can have all updates marked as unread as they come in. Click on the &#8216;unread&#8217; banner (or really any of update except the text) to mark it read, or the new &#8216;Mark all read&#8217; button (the big tick on the side)       </li>
<li><strong>Profile Columns        <br /></strong>Although only supported by the Twitter plugin in this version, MahTweets can now show additional information about a particular contact inside MahTweets, instead of having to go out to the browser.
<p>We&#8217;re looking at making this extensible so &#8216;information&#8217; can be pulled from places like Twadges/etc, once we find the right API&#8217;s. </li>
</ul>
<h3>Improvements</h3>
<ul>
<li><strong>Twitter support        <br /></strong>MahTweets now supports more of the recent twitter features such as:
<ul>
<li>geotagging, </li>
<li>lists, </li>
<li>block&amp;report as spam, </li>
<li>&quot;new style&quot; retweets          </li>
</ul>
</li>
<li><strong>Filtering        <br /></strong>Our filtering was previously pretty good. Now its pretty awesome. Tri-state filtering means you can do nothing, include or <strong>exclude</strong> contacts or streams (&quot;streams&quot; are types of updates, &#8216;mentions&#8217; or &#8216;direct messages&#8217;) from a column.       </li>
<li><strong>UX        <br /></strong>This version started as a big UX/UI overhaul. The key improvements are less WPF blurriness (mostly caused by drop shadows), a &quot;smaller&quot;/less space wasting update template, clearer/nicer looking icons, far more intuitive settings/setup window and a few other niceties.       </li>
<li><strong>Multi-parent behaviour        <br /></strong>This problem is almost exclusive to MahTweets, and we&#8217;ve <em>mostly</em> solved it. Most Twitter clients that support multiple accounts <em>dont</em> support multiple accounts in a single column. Well, since MahTweets <em>does</em> support this, the problem is that what happens when TwitterAccountA and TwitterAccountB are both following TwitterUserC?
<p>Do you double up the Tweet from C so it appears once for A and once for B? Do you make just a single tweet available to whoever got there first? Or do you make some sort of uber tweet which is for both A and B once they&#8217;ve both updated?       </p>
<p>We&#8217;ve chosen the latter option, which creates a drop down box when you go to reply, giving you a list of accounts to reply from:       </p>
<p><a href="http://aeoth.net/blog/wp-content/uploads/MahTweets2.7Released_73BD/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aeoth.net/blog/wp-content/uploads/MahTweets2.7Released_73BD/image_thumb.png" width="284" height="134" /></a>       </p>
<p>That part we&#8217;ve solved, and it works great. The part we <em>haven&#8217;t </em>entirely solved is filtering. If the tweet comes in first from A but is a mention for B, it <em>is</em> marked as a mention for B, but the UI doesn&#8217;t reflect this (ie, no colour change, won&#8217;t always jump to the right column) until the UI is forced to update. Sometimes this doesn&#8217;t happen unless you toggle edit mode on the appropriate columns!       </p>
<p>It&#8217;s complex and a unique problem, but we&#8217;ll get there eventually.       </li>
<li><strong>Better memory usage        <br /></strong>WPF can be a bit of a beast to work with for small memory usage, but we&#8217;re finally getting it down to a more respectable figure. It&#8217;ll vary with how many accounts you have setup, how many columns you have, and if you clear all streams or not on a regular basis, but we&#8217;ve seen 5%-50% less memory usage! </li>
</ul>
<p>There have also been a huge assortment of bugfixes, too many to list.</p>
<h3>MahTweets Website</h3>
<p>The MahTweets website has also undergone a huge overhaul!</p>
<p><a href="http://aeoth.net/blog/wp-content/uploads/MahTweets2.7Released_73BD/image_3.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://aeoth.net/blog/wp-content/uploads/MahTweets2.7Released_73BD/image_thumb_3.png" width="564" height="540" /></a> </p>
<p>Hopefully in the near future we&#8217;ll add some videos showing off some of our somewhat more hidden features, as well as fleshing out the Features, Developers and the return of the Community Plugins pages.</p>
<h3>Future</h3>
<p>So what does the future hold for MahTweets? Apart from a few bug fix releases, we&#8217;ll be releasing a <em>MahTweets Developer Toolkit</em> as well as reenabling community plugins – this will all happen under &quot;2.7&quot;. For the next major version (2.8), we&#8217;ve not nailed down what extra features we want. However, we&#8217;ll hope to have</p>
<ul>
<li>Video uploading (Vimeo, Facebook, Flickr, Viddler, YouTube) </li>
<li>More plugins for Url shortening and Status Handling </li>
<li>Synchronising settings between computers </li>
</ul>
<p>There is also the strong possibility that we&#8217;ll look into creating MahTweets for Android, now that I have a HTC Dream (thanks Will!)</p>
<img src="http://feeds.feedburner.com/~r/TheLeagueOfPaul/~4/xRjlKG6FBY8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.theleagueofpaul.com/blog/2010/01/16/mahtweets-2-7-released/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.theleagueofpaul.com/blog/2010/01/16/mahtweets-2-7-released/</feedburner:origLink></item>
		<item>
		<title>Comments disabled…</title>
		<link>http://feedproxy.google.com/~r/TheLeagueOfPaul/~3/5rTqOhHypFM/</link>
		<comments>http://www.theleagueofpaul.com/blog/2009/12/23/comments-disabled/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 21:53:42 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.theleagueofpaul.com/blog/?p=712</guid>
		<description><![CDATA[Comments are now disabled due to the incredible spam comment increase since upgrading to Wordpress 2.9.
I&#8217;ll look at moving to other blog software by the end of the year, and enable comments again.
]]></description>
			<content:encoded><![CDATA[<p>Comments are now disabled due to the incredible spam comment increase since upgrading to Wordpress 2.9.</p>
<p>I&#8217;ll look at moving to other blog software by the end of the year, and enable comments again.</p>
<img src="http://feeds.feedburner.com/~r/TheLeagueOfPaul/~4/5rTqOhHypFM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.theleagueofpaul.com/blog/2009/12/23/comments-disabled/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.theleagueofpaul.com/blog/2009/12/23/comments-disabled/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 0.378 seconds --><!-- Cached page served by WP-Cache -->
