<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Into Open Source</title>
	<atom:link href="http://dendirken.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dendirken.wordpress.com</link>
	<description>Yet another weblog, like there aren&#039;t enough</description>
	<lastBuildDate>Sat, 17 Dec 2011 03:56:37 +0000</lastBuildDate>
	<language>nl</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='dendirken.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Into Open Source</title>
		<link>http://dendirken.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dendirken.wordpress.com/osd.xml" title="Into Open Source" />
	<atom:link rel='hub' href='http://dendirken.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Don&#8217;t loose your position in an Android ListView</title>
		<link>http://dendirken.wordpress.com/2011/12/16/dont-loose-your-position-in-an-android-listview/</link>
		<comments>http://dendirken.wordpress.com/2011/12/16/dont-loose-your-position-in-an-android-listview/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 17:00:08 +0000</pubDate>
		<dc:creator>Dirk</dc:creator>
				<category><![CDATA[Artikel]]></category>

		<guid isPermaLink="false">http://dendirken.wordpress.com/?p=177</guid>
		<description><![CDATA[As an Android developer you will certainly have to use a ListView sooner or later. And although it can seem hard to implement at first sight it&#8217;s not that hard. In just a few steps you can have your own implementation: Extend your activity from an Android ListActivity Create a class that extends the ArrayAdapter [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=177&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As an Android developer you will certainly have to use a ListView sooner or later. And although it can seem hard to implement at first sight it&#8217;s not that hard.<br />
In just a few steps you can have your own implementation:</p>
<ol>
<li>Extend your activity from an Android ListActivity</li>
<li>Create a class that extends the ArrayAdapter</li>
<li>In that class, implement the getView(int position, View convertView, ViewGroup parent) method</li>
</ol>
<p>Then from your list activity you can create an adapter to show your list. Basically that&#8217;s it.<br />
Loading the data initially into your list is no big deal. However, you may experience that when you change the data, and want to reload it that you loose the position in the list where you were. And that&#8217;s exactly what we will solve here!</p>
<h2>Different ways of refreshing a ListView</h2>
<p>To easily explain all this we will start from an easy example where we will list 20 customer-objects. When loading is done we wait for 5 seconds during which you can scroll as much as you want. After those 5 seconds we update one element (the last one) in the list and refresh the list on the device while trying to keep our scroll position correctly set. So ideally when you try this example, you start the demo application, you scroll all the way down in the list, way a few seconds and you will see that the last element in the list gets updated AND that your scrolling position is still at the bottom (and not reset to the top!). So this is the situation we start from:<br />
<code>public class DemoListViewActivity extends ListActivity {<br />
private List customers;<br />
@Override<br />
protected void onCreate(Bundle savedInstanceState) {<br />
super.onCreate(savedInstanceState);<br />
setContentView(R.layout.list_view_layout);<br />
loadData(true);<br />
//Create an AsyncTask taht runs for 5 seconds in the background<br />
//During that time you scroll as much as you like<br />
//After the 5 seconds the list is refreshed and we try to keep the scrollposition<br />
AsyncTask task = new AsyncTask() {<br />
@Override<br />
protected Object doInBackground(Object... objects) {<br />
try {<br />
Thread.sleep(5000L); //Wait for 5 seconds and update the data<br />
customers.remove(customers.size() - 1); //Remove the last element<br />
Customer c = new Customer();<br />
c.setFirstName("Google");<br />
c.setLastName("Android");<br />
customers.add(c); //Add a new element add the last place<br />
} catch (InterruptedException e) {}<br />
return null;<br />
}<br />
@Override<br />
protected void onPostExecute(Object object) {<br />
loadData(false);<br />
}<br />
}.execute();<br />
}<br />
private void loadData(boolean createNew) {<br />
if (createNew) {<br />
//ToDO Load some data from a database, local storage or the web<br />
customers = new ArrayList();<br />
for (int i = 0; i &lt; 20; i++) {<br />
Customer c = new Customer();<br />
c.setFirstName("Dummy " + i);<br />
c.setLastName("Object " + i);<br />
customers.add(c);<br />
}<br />
}<br />
}<br />
}</code></p>
<h3>How to loose your position &#8211; part 1</h3>
<p>The easiest way is to always create a new instance of your adapter and put the list of objects to display on it:<br />
<code> CustomerListAdapater cla = new CustomerListAdapater(DemoListViewActivity.this, customers);<br />
super.setListAdapter(cla);</code></p>
<p>Adding these lines at the end of the loadData method works, the list gets updated but you always jump back to the top of the list. And that&#8217;s not really what we want&#8230;</p>
<h3>How to loose your position &#8211; part 2</h3>
<p>Antoher way is to find out what the index of the first displayed list element is, reload the list and then force the list to scroll back to that index you got:<br />
<code>int fistVisiblePosition = getListView().getFirstVisiblePosition(); CustomerListAdapater cla = new CustomerListAdapater(DemoListViewActivity.this, customers); super.setListAdapter(cla); super.setSelection(fistVisiblePosition);</code><br />
These lines are again added to the end of the loadData method, and this also works. You even keep your scroll position. Or more or less&#8230; If you scrolled the list and the first visible item in your list is displayed only half, then after the refresh it will be displayed entirely. So we are close to a good solution, but you feel this isn&#8217;t natural.</p>
<h3>How to keep your position</h3>
<p>But we can do better, more natural! In the previous two examples you saw that we always recreated the adapter. And that is eventually causing the reset of the scroll position. So what if we could keep the adapter and re-use it?<br />
Well let&#8217;s try this. We need to add a method to the adapter to set the new data:<br />
<code> public void reload(List customers) {<br />
this.customers.clear();<br />
this.customers.addAll(customers);<br />
notifyDataSetChanged();<br />
}</code><br />
And afterwards we can get a reference of the adapater in the ListActivity and call the reload method. If no reference is found we create a new adapter (like in the first method):<br />
<code> if (super.getListView().getAdapter() == null) {<br />
CustomerListAdapater cla = new CustomerListAdapater(DemoListViewActivityPart3.this, customers);<br />
super.setListAdapter(cla);<br />
} else {<br />
((CustomerListAdapater)super.getListView().getAdapter())<br />
.reload(customers);<br />
}<br />
</code></p>
<h2>Conclusion</h2>
<p>It&#8217;s not hard at all to change your implementation and keep the scroll position in the future. And if, in some cases, you have to jump back to the top of the list, you can easily re-create the adapter and job done!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dendirken.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dendirken.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dendirken.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dendirken.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dendirken.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dendirken.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dendirken.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dendirken.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dendirken.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dendirken.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dendirken.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dendirken.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dendirken.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dendirken.wordpress.com/177/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=177&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dendirken.wordpress.com/2011/12/16/dont-loose-your-position-in-an-android-listview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f7489060ed51ed33938c0cb0d493eb2?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">dendirken</media:title>
		</media:content>
	</item>
		<item>
		<title>Let the monkey go wild&#8230;</title>
		<link>http://dendirken.wordpress.com/2011/01/04/let-the-monkey-go-wild/</link>
		<comments>http://dendirken.wordpress.com/2011/01/04/let-the-monkey-go-wild/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 21:13:58 +0000</pubDate>
		<dc:creator>Dirk</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Artikel]]></category>
		<category><![CDATA[adb]]></category>
		<category><![CDATA[avd]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://dendirken.wordpress.com/?p=166</guid>
		<description><![CDATA[Imagine the monkey on the left working with your mobile Android application&#8230; Yeah that&#8217;s where I&#8217;m going, making your application monkey proof. It&#8217;s something that should be done for every application, but for christ sake, how do you test if your application is monkey proof? ADB Before I explain you the solution that comes with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=166&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-170" title="The Monkey" src="http://dendirken.files.wordpress.com/2011/01/code_monkey_small.jpg?w=145&#038;h=180" alt="" width="145" height="180" />Imagine the monkey on the left working with your mobile Android application&#8230; Yeah that&#8217;s where I&#8217;m going, making your application monkey proof. It&#8217;s something that should be done for every application, but for christ sake, how do you test if your application is monkey proof?</p>
<p><strong>ADB</strong><br />
Before I explain you the solution that comes with the Android SDK I should first get into ADB. ADB is the abbreviation for Android Device Bridge. It&#8217;s a utility in the SDK that allows developers to connect to their Android devices (Real devices or emulator devices (AVD&#8217;s)) and execute some actions on it. For example with ADB you can reboot a device, push files to it, get files from it, look into the SQLite database instance (only available for dev phones or emulators),&#8230; The tool can only be used from command line.<br />
<span id="more-166"></span></p>
<p><strong>ADB Monkey</strong><br />
So now you what you can do with ADB, there&#8217;s even more! Google provides a monkey tester in the ADB. What it does:<br />
It starts the application you want to monkey test and then starts firing all kind of simulated events. An simulated event can be a finger touch, the usage of the back button, usage of the menu button, a press on the camera or multimedia button, start playing music while your application is on top,&#8230; Every possible event a user can fire on any device when using your application can be simulated using the ADB Monkey tool. If any of the simulated events causes the application to crash, an entire stacktrace is available at the command line.</p>
<p>It&#8217;s quite easy to use. There&#8217;s only one thing you need to know, the package of the application you want to test which is defined in your application&#8217;s AndroidManifest.xml file. Next open a command line and use it to navigate to the SDK directory. In the SDK directory navigate to the tools directory in the root of the SDK or in the <em>platforms/android-X/</em> directory. Once you&#8217;re there just execute this command (with your package declaration off course):</p>
<p><code>adb shell monkey -p your.package.declaration -v 500</code></p>
<p>This command will fire 500 random events to your application and will, if you&#8217;re application is properly designed, only output the launch of all the simulated events. An excerpt of the output:</p>
<p><code>:Sending Pointer ACTION_MOVE x=-3.0 y=4.0<br />
:Sending Pointer ACTION_DOWN x=244.0 y=371.0<br />
:Sending Pointer ACTION_UP x=244.0 y=371.0<br />
:Sending Pointer ACTION_DOWN x=163.0 y=98.0<br />
:Sending Pointer ACTION_UP x=163.0 y=98.0<br />
:Sending Pointer ACTION_MOVE x=-2.0 y=3.0<br />
:Sending Pointer ACTION_MOVE x=2.0 y=-1.0<br />
:Sending Flip keyboardOpen=false<br />
:Sending Pointer ACTION_DOWN x=193.0 y=137.0<br />
:Sending Pointer ACTION_UP x=178.0 y=139.0<br />
:Sending Pointer ACTION_DOWN x=295.0 y=451.0<br />
:Sending Pointer ACTION_UP x=295.0 y=451.0<br />
:Sending Pointer ACTION_MOVE x=2.0 y=-3.0<br />
:Sending Pointer ACTION_DOWN x=249.0 y=465.0<br />
:Sending Pointer ACTION_UP x=249.0 y=465.0<br />
:Sending Pointer ACTION_DOWN x=153.0 y=336.0<br />
:Sending Pointer ACTION_UP x=152.0 y=345.0<br />
:Sending Pointer ACTION_DOWN x=65.0 y=316.0<br />
:Sending Pointer ACTION_UP x=65.0 y=316.0<br />
// Sending event #400<br />
:Sending Pointer ACTION_MOVE x=4.0 y=3.0<br />
:Sending Pointer ACTION_DOWN x=92.0 y=470.0<br />
:Sending Pointer ACTION_UP x=92.0 y=470.0<br />
:Sending Pointer ACTION_MOVE x=2.0 y=-1.0<br />
:Sending Pointer ACTION_DOWN x=289.0 y=234.0<br />
:Sending Pointer ACTION_UP x=289.0 y=234.0<br />
:Sending Pointer ACTION_DOWN x=45.0 y=452.0<br />
:Sending Pointer ACTION_UP x=45.0 y=452.0<br />
:Sending Pointer ACTION_MOVE x=2.0 y=2.0<br />
:Sending Pointer ACTION_DOWN x=59.0 y=459.0<br />
:Sending Pointer ACTION_UP x=59.0 y=459.0<br />
:Sending Pointer ACTION_MOVE x=-4.0 y=1.0<br />
:Sending Pointer ACTION_DOWN x=57.0 y=384.0<br />
:Sending Pointer ACTION_UP x=57.0 y=384.0<br />
:Sending Pointer ACTION_DOWN x=304.0 y=165.0<br />
:Sending Pointer ACTION_UP x=304.0 y=166.0<br />
:Sending Pointer ACTION_MOVE x=1.0 y=3.0<br />
:Sending Pointer ACTION_MOVE x=-2.0 y=-3.0<br />
Events injected: 500<br />
: Dropped: keys=0 pointers=0 trackballs=0 flips=0<br />
## Network stats: elapsed time=7178ms (0ms mobile, 7178ms wifi, 0ms not connected)<br />
// Monkey finished</code></p>
<p>For more information on monkey and it&#8217;s configuration options you can visit the Android SDK webiste: <a href="http://developer.android.com/guide/developing/tools/monkey.html">http://developer.android.com/guide/developing/tools/monkey.html</a><br />
<strong></strong></p>
<p><strong>Caution</strong><br />
Before you get to ambitious and want to fire like a 30.000 events to your application make sure that you read the next sentence well! <strong>Once the monkey has been started, he can&#8217;t be stopped!</strong> You can however quit the command line and hope that it sends some kind of kill command to the monkey running on the device or emulator but it won&#8217;t stop on your device or emulator. So if you want to fire a really large number of events do it on an emulator (you can always close the emulator when you want) or do it on a device that you don&#8217;t need the next couple of hours!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dendirken.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dendirken.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dendirken.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dendirken.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dendirken.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dendirken.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dendirken.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dendirken.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dendirken.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dendirken.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dendirken.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dendirken.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dendirken.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dendirken.wordpress.com/166/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=166&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dendirken.wordpress.com/2011/01/04/let-the-monkey-go-wild/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f7489060ed51ed33938c0cb0d493eb2?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">dendirken</media:title>
		</media:content>

		<media:content url="http://dendirken.files.wordpress.com/2011/01/code_monkey_small.jpg?w=242" medium="image">
			<media:title type="html">The Monkey</media:title>
		</media:content>
	</item>
		<item>
		<title>Using dialogs in Android</title>
		<link>http://dendirken.wordpress.com/2010/10/26/using-dialogs-in-android/</link>
		<comments>http://dendirken.wordpress.com/2010/10/26/using-dialogs-in-android/#comments</comments>
		<pubDate>Tue, 26 Oct 2010 18:35:52 +0000</pubDate>
		<dc:creator>Dirk</dc:creator>
				<category><![CDATA[Artikel]]></category>

		<guid isPermaLink="false">http://dendirken.wordpress.com/?p=153</guid>
		<description><![CDATA[In Android dialogs are those little popups you can sometimes see. As a developer it&#8217;s a handy thing to show messages to the user, display loading dialogs, show errors that occured,&#8230; And it&#8217;s pretty easy to implement! Although I had some problems using them, but first let&#8217;s start creating a dialog! Creating dialogs As I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=153&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://dendirken.files.wordpress.com/2010/10/dialog_custom.png"><img class="alignleft size-full wp-image-154" title="Android Dialog" src="http://dendirken.files.wordpress.com/2010/10/dialog_custom.png?w=475" alt=""   /></a> In Android dialogs are those little popups you can sometimes see. As a developer it&#8217;s a handy thing to show messages to the user, display loading dialogs, show errors that occured,&#8230; And it&#8217;s pretty easy to implement! Although I had some problems using them, but first let&#8217;s start creating a dialog!</p>
<p><span id="more-153"></span></p>
<p><strong>Creating dialogs</strong></p>
<p>As I said before, creating dialogs i quite easy. One thing you need to know is that each &#8216;type&#8217; of dialog you make requires an id. So let&#8217;s assume the following block of code:</p>
<p><pre class="brush: plain;">    //Constants used to create dialogs
    private static final int LAODING_DIALOG = 0;
    private static final int WARNING_DIALOG = 1;
    private static final int WARNING_DIALOG_DYNAMIC = 2;

    @Override
    protected Dialog onCreateDialog(int id) {
        Dialog dialog = null;
        switch(id) {
            case LAODING_DIALOG: {
                ProgressDialog progressDialog = new ProgressDialog(this);
                progressDialog.setMessage(&quot;Laoding...&quot;);
                dialog = progressDialog;
                break;
            }
            case WARNING_DIALOG: {
                AlertDialog errorDialog = new AlertDialog.Builder(this)
                    .setMessage(&quot;An error occured!&quot;)
                    .setCancelable(false)
                    .setNeutralButton(R.string.dialogOK, new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int id) {
                            dialog.dismiss();
                            //dismissDialog(WARNING_DIALOG) should also work!
                    }
                }).create();
                dialog = errorDialog;
                break;
            }
            case WARNING_DIALOG_DYNAMIC: {
                AlertDialog errorDialog = new AlertDialog.Builder(this)
                    .setMessage(&quot;An error occured! Time: &quot; + new Date())
                    .setCancelable(false)
                    .setNeutralButton(R.string.dialogOK, new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int id) {
                            removeDialog(MY_EPISODES_ERROR_DIALOG);
                        }
                    }).create();
                dialog = errorDialog;
                break;
            }
            default:
                dialog = super.onCreateDialog(id);
                break;
            }
        return dialog;
    }</pre><br />
This code will compile&#8230; but you won&#8217;t notice any difference in the execution of your application. We still need to start the dialogs. But before we do so we&#8217;ll first go into detail on this code snippet.<br />
In order to be able to create dialogs you need to overwrite the &#8216;onCreateDialog&#8217; method which takes exactly one parameter, id. With this parameter you identify the dialog to be shown mostly using a switch. And to keep things a bit organized the identifiers are stored on the class (or a utility class) as a integer constant.<br />
In this sample we have three dialogs, one loading dialog with a circle spinning around while loading, next a static dialog showing the text &#8220;An error occured&#8221; and finally a dynamic dialog showing the same message as the static dialog but including the time of the creation of the dialog. The loading dialog does not have any button to close it, it will be done in code. The other two dialogs have a close button which will remove the dialog from the screen.</p>
<p><strong>Working with the dialogs</strong></p>
<p>As mentioned in the previous paragraph this code snippet does not yet start the dialogs. Therefore we need some code like this:<br />
<pre class="brush: plain;">showDialog(LAODING_DIALOG);
//Do some complicated stuff that requires a loading dialog...
dismissDialog(LAODING_DIALOG);</pre></p>
<p>For showing the loading dialog this should already work. But make sure for loading dialogs you start the dialog in a different thread than the thread in which you do the complicated stuff (have a look at <a title="Article &quot;AsyncTask makes Threading fun&quot;" href="http://dendirken.wordpress.com/2010/09/11/asynctask-makes-threading-fun/" target="_self">AsyncTasks</a>). For the other two dialogs you only need the &#8216;showDialog&#8217;-call as closing them should be done by the user (in the onClickListener). The code for those would look like this:<br />
<pre class="brush: plain;">showDialog(WARNING_DIALOG);
showDialog(WARNING_DIALOG_DYNAMIC);</pre><br />
<strong>Dismiss or remove dialogs</strong></p>
<p>As you can see in all the code samples of this article there are two options to get rid off a dialog. And both have their usages.<br />
First you can dismiss a dialog (<em>dissmissDialog(int id)</em>). Dismissing a dialog will make it disappear but the activity will still keep a reference to it. So next time you want to show it, it doesn&#8217;t need to be created again, it will just popup. Removing a dialog is exactly the opposite, any reference to the dialog will be removed and next time you want show the dialog it will be re-created.</p>
<p>And that is the big difference. Re-create or store a reference&#8230; As you can see in the first code snippet when we want to get rid off the static warning dialog (<em>WARNING_DIALOG</em>) we just dismiss it. When we want to get rid off the dynamic dialog (<em>WARNING_DIALOG_DYNAMIC</em>) we remove it. Why the difference&#8230; Well it quite easy. If we show the dynamic dialog for the first time it will show the message ending with the current date and time (for example October 26, 2010 7:21 PM). Now if we dismiss the dialog instead of removing it and we show it a second time the text displayed will be exactly the same as the first time. Because&#8230; the dialog is not created again. If we remove the dialog and show it again the second time it will show an updated time (for example October 26, 2010 7:22 PM).<br />
So what does this learn us? Dismissing a dialog is nothing more than just hiding the dialog. So if you have a dynamic dialog you should always get rid of it by removing it. But there&#8217;s more&#8230; Look back at the loading dialog&#8230;</p>
<p>The loading dialog only gets closed in code. Let&#8217;s say we have a button on the screen, if the user clicks it some data will be loaded from the internet. Before we start loading the data we&#8217;ll show the dialog, afterwards we want to get rid of the dialog. The code snippet above will perfectly do this for you. Only when you click the button the second time, the opening loading dialog will not have a spinning circle. In fact the circle is there but it&#8217;s not moving at all! That&#8217;s because you have to look at a loading dialog as dynamic dialog. So instead of dismissing the dialog we should also remove it!<br />
<pre class="brush: plain;">showDialog(LAODING_DIALOG);
//Do some complicated stuff that requires a loading dialog...
removeDialog(LAODING_DIALOG);</pre><br />
Now your loading-circle will spin again!</p>
<p>The rules are:</p>
<ul>
<li>Can the text to be displayed in a dialog be different: always <strong>remove</strong> the dialog</li>
<li>Does the dialog contains any animation (spinning wheels, loading bars,&#8230;): always <strong>remove</strong> the dialog</li>
<li>It the dialog completely static (no text that ever changes, no animated images,&#8230;): it&#8217;s safe to <strong>dismiss</strong> the dialog</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dendirken.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dendirken.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dendirken.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dendirken.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dendirken.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dendirken.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dendirken.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dendirken.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dendirken.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dendirken.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dendirken.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dendirken.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dendirken.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dendirken.wordpress.com/153/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=153&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dendirken.wordpress.com/2010/10/26/using-dialogs-in-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f7489060ed51ed33938c0cb0d493eb2?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">dendirken</media:title>
		</media:content>

		<media:content url="http://dendirken.files.wordpress.com/2010/10/dialog_custom.png" medium="image">
			<media:title type="html">Android Dialog</media:title>
		</media:content>
	</item>
		<item>
		<title>Android changing orientation issues</title>
		<link>http://dendirken.wordpress.com/2010/09/12/android-changing-orientation-issues/</link>
		<comments>http://dendirken.wordpress.com/2010/09/12/android-changing-orientation-issues/#comments</comments>
		<pubDate>Sun, 12 Sep 2010 10:00:07 +0000</pubDate>
		<dc:creator>Dirk</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Artikel]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[Smartphone]]></category>
		<category><![CDATA[user interface]]></category>

		<guid isPermaLink="false">http://dendirken.wordpress.com/?p=126</guid>
		<description><![CDATA[Where is the issue? Developing an Android application I always had a strange error in my application and didn&#8217;t know how to prevent it. Until last week. The problem was that upon loading the application some data was loaded over the internet connection. So it sometimes took a while to load the data and the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=126&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Where is the issue?</strong><br />
Developing an Android application I always had a strange error in my application and didn&#8217;t know how to prevent it. Until last week. The problem was that upon loading the application some data was loaded over the internet connection. So it sometimes took a while to load the data and the according loading dialog was shown for quite some time then. Whenever you tried to change orientation of your device (switch between landscape and portrait)  the error occured:</p>
<p><pre class="brush: plain;">
09-11 11:12:41.601: ERROR/AndroidRuntime(264): FATAL EXCEPTION: main
        java.lang.IllegalArgumentException: no dialog with id 0 was ever shown via Activity#showDialog
        at android.app.Activity.missingDialog(Activity.java:2590)
        at android.app.Activity.dismissDialog(Activity.java:2575)
        ...
        at dalvik.system.NativeStart.main(Native Method)
</pre></p>
<p>In order to solve this error you need to prevent that your data is reloaded upon changing the screen orientation of the application. Why? Because standard when some Android configuration option changes the OS will drop the current activity and try to re-create it and so call the <em>onCreate(Bundle savedInstance)</em> of your activity again. If you have any loading dialog that you want to be hidden upon finishing, the application will crash because more than one loading dialog has been created and they should all be dismissed but only one will still exist.</p>
<p><span id="more-126"></span><br />
<strong>AndroidManifest Fix</strong><br />
The easiest way of handling this issue is to edit your <em>AndroidManifest.xml</em> file and declare for each activity that the <em>onCreate(Bundle savedInstance)</em> shouldn&#8217;t be called for the orientation changes. This is how you should change your manifest file:</p>
<p><pre class="brush: plain;">
        &lt;activity android:name=&quot;.MainApp&quot;
                  android:label=&quot;@string/app_name&quot;
                  android:configChanges=&quot;orientation|keyboardHidden&quot;&gt;
            ...
        &lt;/activity&gt;
</pre></p>
<p>As you can see we&#8217;ve added the <em>android:configChanges=&#8221;orientation|keyboardHidden&#8221;</em> property to the activity tag. You can do so for every activity where you do not want the activity to be recreated upon changing the orientation. This solution works like a charm but there is something odd. As you see we didn&#8217;t tell the activity to skip the recreation only on orientation but also for hiding the keyboard. When you remove the <em>keyboardHidden</em> it doesn&#8217;t work anymore. But why?</p>
<p>If we have a look at the Android loggings we can retrieve from our test-device or virtual machine (AVD) we have something like this:</p>
<p><pre class="brush: plain;">
09-11 11:37:56.321: INFO/ActivityManager(58): Config changed: { scale=1.0 imsi=310/260 loc=nl_BE touch=3 keys=2/1/1 nav=3/1 orien=2 layout=34 uiMode=17 seq=56}
09-11 11:37:58.141: INFO/ActivityManager(58): Config changed: { scale=1.0 imsi=310/260 loc=nl_BE touch=3 keys=2/1/2 nav=3/1 orien=2 layout=34 uiMode=17 seq=57}
09-11 11:37:58.639: INFO/ActivityManager(58): Config changed: { scale=1.0 imsi=310/260 loc=nl_BE touch=3 keys=2/1/2 nav=3/1 orien=1 layout=34 uiMode=17 seq=58}
09-11 11:38:00.930: INFO/ActivityManager(58): Config changed: { scale=1.0 imsi=310/260 loc=nl_BE touch=3 keys=2/1/1 nav=3/1 orien=2 layout=34 uiMode=17 seq=59}
09-11 11:38:02.995: INFO/ActivityManager(58): Config changed: { scale=1.0 imsi=310/260 loc=nl_BE touch=3 keys=2/1/2 nav=3/1 orien=2 layout=34 uiMode=17 seq=60}
09-11 11:38:03.400: INFO/ActivityManager(58): Config changed: { scale=1.0 imsi=310/260 loc=nl_BE touch=3 keys=2/1/2 nav=3/1 orien=1 layout=34 uiMode=17 seq=61}
09-11 11:38:05.560: INFO/ActivityManager(58): Config changed: { scale=1.0 imsi=310/260 loc=nl_BE touch=3 keys=2/1/1 nav=3/1 orien=2 layout=34 uiMode=17 seq=62}
09-11 11:38:07.650: INFO/ActivityManager(58): Config changed: { scale=1.0 imsi=310/260 loc=nl_BE touch=3 keys=2/1/2 nav=3/1 orien=2 layout=34 uiMode=17 seq=63}
09-11 11:38:08.080: INFO/ActivityManager(58): Config changed: { scale=1.0 imsi=310/260 loc=nl_BE touch=3 keys=2/1/2 nav=3/1 orien=1 layout=34 uiMode=17 seq=64}
09-11 11:38:10.350: INFO/ActivityManager(58): Config changed: { scale=1.0 imsi=310/260 loc=nl_BE touch=3 keys=2/1/1 nav=3/1 orien=2 layout=34 uiMode=17 seq=65}
09-11 11:38:12.880: INFO/ActivityManager(58): Config changed: { scale=1.0 imsi=310/260 loc=nl_BE touch=3 keys=2/1/2 nav=3/1 orien=2 layout=34 uiMode=17 seq=66}
09-11 11:38:13.310: INFO/ActivityManager(58): Config changed: { scale=1.0 imsi=310/260 loc=nl_BE touch=3 keys=2/1/2 nav=3/1 orien=1 layout=34 uiMode=17 seq=67}
09-11 11:41:40.191: INFO/ActivityManager(58): Config changed: { scale=1.0 imsi=310/260 loc=nl_BE touch=3 keys=2/1/1 nav=3/1 orien=2 layout=34 uiMode=17 seq=68}
</pre></p>
<p>Have a close look at all those logging lines and you&#8217;ll see why we added the keyboard hiding to the list. The value of <em>orien</em> changes (1 or 2) but also the <em>keys</em> value changes (2/1/1 or 2/1/2). Probably this is because a different keyboard has to be shown when in landscape or portrait mode.</p>
<p><strong>Save the Activity state</strong><br />
The second solution is a little harder to implement but fixes the problem as well. The advantage of this solution compared to the first one is that you have full control on the reloading process, although the re-creation of the activity isn&#8217;t skipped this way.</p>
<p>The <em>Activity</em> class you have to inherit from every time you create an Activity has some useful methods to override.</p>
<ul>
<li>The <em>onSaveInstanceState(Bundle outState)</em> will store the current state of your activity somewhere on the device. In case the activity needs to be recreated (so on an orientation switch for example) this saved state will be used.</li>
<li>The <em>onDestroy()</em> method will be called when the activity is about to recreated. First the state will be saved, afterwards the activity will be destroyed and finally it will created again.</li>
</ul>
<p>So now we now this we could implement it this way:</p>
<p><pre class="brush: plain;">
public class MyActivity extends Activity {
    private List myData;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.myLayout);

        Object s1 = savedInstance.getSerializable(&quot;myData&quot;);
        if(s1 == null) {
            //Now data found so get it yourself
            //Some call to a webservice or somthing to retrieve your data
            loadDataAndShowLoadingDialog();
        } else {
            //Data found on the savedInstance
            myData = (ArrayList) s1;
        }
    }

    public void loadDataAndShowLoadingDialog() {
        //Show loading dialog
        //Load data
        //Hide loading dialog
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        ArrayList data = (ArrayList)myData;
        outState.putSerializable(&quot;myData&quot;, data);
        super.onSaveInstanceState(outState);
    }

    @Override
    protected void onDestroy() {
        dismissDialog(LOADING_DIALOG);
        super.onDestroy();
    }
}
</pre></p>
<p>In the<em> onDestroy()</em> method the loading dialog is dismissed just to be sure there is only one loading dialog of this kind available on the UI thread. Otherwise the issue could still remain!</p>
<p><strong>Conclusion</strong><br />
Which of both methods is best to be used? In fact there is no correct answer. Both will work, and both have there advantages and disadvantages so it&#8217;s up to you. What do you want? Keep your code clean and solve the issue more globally then go for solution one. Are you willing to get your hands dirty and have more control on the issue (what data should be reloaded and what data shouldn&#8217;t then go for solution 2.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dendirken.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dendirken.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dendirken.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dendirken.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dendirken.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dendirken.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dendirken.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dendirken.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dendirken.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dendirken.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dendirken.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dendirken.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dendirken.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dendirken.wordpress.com/126/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=126&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dendirken.wordpress.com/2010/09/12/android-changing-orientation-issues/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f7489060ed51ed33938c0cb0d493eb2?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">dendirken</media:title>
		</media:content>
	</item>
		<item>
		<title>AsyncTask makes Threading fun</title>
		<link>http://dendirken.wordpress.com/2010/09/11/asynctask-makes-threading-fun/</link>
		<comments>http://dendirken.wordpress.com/2010/09/11/asynctask-makes-threading-fun/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 01:10:22 +0000</pubDate>
		<dc:creator>Dirk</dc:creator>
				<category><![CDATA[Artikel]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google code]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[myepisodes.com]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://dendirken.wordpress.com/?p=111</guid>
		<description><![CDATA[Threading can be a hard issue for developers and whenever you have to implement some threading yourself it&#8217;s always a hard job and the code you produce will never look great! So if we can avoid to implement Runnable and all the stuff we probably will. However I implemented some threading myself in an Android [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=111&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://dendirken.files.wordpress.com/2010/09/android-s1-2a.jpg"><img class="alignleft size-medium wp-image-120" title="DroidBot Danger" src="http://dendirken.files.wordpress.com/2010/09/android-s1-2a.jpg?w=300&#038;h=225" alt="" width="300" height="225" /></a>Threading can be a hard issue for developers and whenever you have to implement some threading yourself it&#8217;s always a hard job and the code you produce will never look great! So if we can avoid to implement Runnable and all the stuff we probably will. However I implemented some threading myself in an Android application and it didn&#8217;t look nice at all!</p>
<p>Threading in an Android application? Indeed, and here&#8217;s why. In Android if you want to show a loading dialog while you are loading some data from let&#8217;s say a web service (which can take some time to finish as you are not entirely sure what kind of internet connection is available on the device) you have to start using threading. The reason why you have to use threading for it is because the loading dialog needs to be updated all the time (with a percentage, some graphical circle that goes around etc) and at the exact same time you want to get your data from your service.<span id="more-111"></span>So here is how I originally implemented it in the <a title="MyEpisodes Manager" href="http://code.google.com/p/my-episodes-watch-manager/" target="_blank">MyEpisodes Manager</a> project:</p>
<p><pre class="brush: plain;">
public class EpisodesWatchListActivity extends Activity {
        private Runnable viewEpisodes;

        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.watchlist);
            //Do some other stuff on creation
            reloadEpisodes();
            //Do some other stuff on creation
        }

        private void reloadEpisodes() {
		showDialog(EPISODE_LOADING_DIALOG);
		viewEpisodes = new Runnable() {
			@Override
			public void run() {
				getEpisodes();
			}
		};

		Thread thread =  new Thread(null, viewEpisodes, &quot;EpisodeRetrievalBackground&quot;);
		thread.start();
        }

	private void getEpisodes() {
		try {
			episodes = myEpisodesService.retrieveEpisodes(episodesType, user);
		} catch (InternetConnectivityException e) {
			String message = &quot;Could not connect to host&quot;;
			Log.e(LOG_TAG, message, e);
			exceptionMessageResId = R.string.internetConnectionFailureReload;
		} catch(FeedUrlParsingException e) {
			String message = &quot;Exception occured:&quot;;
			Log.e(LOG_TAG, message, e);
			exceptionMessageResId = R.string.watchListUnableToReadFeed;
		} catch (Exception e) {
			String message = &quot;Exception occured:&quot;;
			Log.e(LOG_TAG, message, e);
			exceptionMessageResId = R.string.defaultExceptionMessage;
		}
		runOnUiThread(returnEpisodes);
	}

	private Runnable returnEpisodes = new Runnable() {
            //Update the view (input fields, lists,...)
            dismissDialog(EPISODE_LOADING_DIALOG);
        }
}
</pre></p>
<p>A little explanation of what will happen and why:</p>
<ul>
<li>On creation of the activity the method to (re)load the data is called.</li>
<li>Next the dialog is started on the current thread (which is also known as the UI-thread).</li>
<li>Now we&#8217;ll create a Thread in which the actual data will be retrieved, to make things a bit more understandable we created a separate method for purpose.</li>
<li>After the data is loaded in the application we still have two things left to do, first of all the view must be updated with the new data loaded, next the loading dialog should be hidden. And here happens a little magic.  In your entire application there will be only one thread which you can use to update the view, this thread we call the UI-thread. Therefore we can use the<em> runOnUiThread(Runnable runnable)</em> method available in the Activity super class.</li>
<li>In this runnable-instance we should first update the view and when it&#8217;s all done we should dismiss the dialog (or in other words just close the dialog)</li>
</ul>
<p>Now because this looks like one big mess Android came up with a simple solution, called AsyncTasks. I&#8217;ve re-written the previous example to fit in with the AsyncTasks and suddenly it looks a lot more clean. See the example here:</p>
<p><pre class="brush: plain;">
public class EpisodesWatchListActivity extends Activity {
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.watchlist);
            //Do some other stuff on creation
            reloadEpisodes();
            //Do some other stuff on creation
        }

        private void reloadEpisodes() {
            AsyncTask asyncTask = new AsyncTask() {
                @Override
                protected void onPreExecute() {
                    showDialog(EPISODE_LOADING_DIALOG);
                }

                @Override
                protected Object doInBackground(Object... objects) {
                    getEpisodes();
                    return 100L; //In my case I do not need a return value so I return some default value!
                }

                @Override
                protected void onPostExecute(Object o) {
                    updateView();
                    dismissDialog(EPISODE_LOADING_DIALOG);
                }
            };
            asyncTask.execute();
        }

	private void getEpisodes() {
		try {
			episodes = myEpisodesService.retrieveEpisodes(episodesType, user);
		} catch (InternetConnectivityException e) {
			String message = &quot;Could not connect to host&quot;;
			Log.e(LOG_TAG, message, e);
			exceptionMessageResId = R.string.internetConnectionFailureReload;
		} catch(FeedUrlParsingException e) {
			String message = &quot;Exception occured:&quot;;
			Log.e(LOG_TAG, message, e);
			exceptionMessageResId = R.string.watchListUnableToReadFeed;
		} catch (Exception e) {
			String message = &quot;Exception occured:&quot;;
			Log.e(LOG_TAG, message, e);
			exceptionMessageResId = R.string.defaultExceptionMessage;
		}
	}

	private void updateView() {
            //Update the view (input fields, lists,...)
        }
}
</pre></p>
<p>I hope you notice that this code is a lot more easier to read than the previous. What it does:</p>
<ul>
<li>First of all a new AsyncTask gets instantiated and implemented.</li>
<li>The method <em>doInBackground(Object&#8230; objects)</em> is the only that must be implemented. So the name already tells you that this is the method that will start a new thread and execute some stuff you define in that thread. In our case the data gets loaded from a web service.</li>
<li>Next we also have to implement the <em>onPreExecute()</em> method in order to be able to start the loading dialog.</li>
<li>And off course the <em>onPostExecute(Object e)</em> method which will hide the loading dialog when the data is loaded.</li>
<li>As you see the <em>runOnUiThread(Runnable runnable)</em> has been removed from the <em>getEpisodes()</em> method but everything done in this method has been moved the <em>onPostExecute(Object e)</em> method as this last mentioned method will not run in a seperate thread but on the UI-thread itself!</li>
</ul>
<p>I also created a sample Android project called &#8216;LoadingDialogsAndThreading&#8217; which you can find it on Google Code in the <a title="Sample project 'LoadingDialogsAndThreading'" href="http://code.google.com/p/my-android-samples/source/browse/#svn/trunk/LoadingDialogsAndThreading%3Fstate%3Dclosed" target="_blank">my-android-samples</a> project.<br />
It&#8217;s easy, not a lot of work to change your code and it makes it lot more readable for other developers. So definitely something to look into!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dendirken.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dendirken.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dendirken.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dendirken.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dendirken.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dendirken.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dendirken.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dendirken.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dendirken.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dendirken.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dendirken.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dendirken.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dendirken.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dendirken.wordpress.com/111/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=111&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dendirken.wordpress.com/2010/09/11/asynctask-makes-threading-fun/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f7489060ed51ed33938c0cb0d493eb2?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">dendirken</media:title>
		</media:content>

		<media:content url="http://dendirken.files.wordpress.com/2010/09/android-s1-2a.jpg?w=300" medium="image">
			<media:title type="html">DroidBot Danger</media:title>
		</media:content>
	</item>
		<item>
		<title>Android: The danger of widgets</title>
		<link>http://dendirken.wordpress.com/2010/05/29/android-the-danger-of-updating-a-widget/</link>
		<comments>http://dendirken.wordpress.com/2010/05/29/android-the-danger-of-updating-a-widget/#comments</comments>
		<pubDate>Fri, 28 May 2010 22:52:51 +0000</pubDate>
		<dc:creator>Dirk</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Artikel]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[device]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google code]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[user interface]]></category>

		<guid isPermaLink="false">http://dendirken.wordpress.com/?p=102</guid>
		<description><![CDATA[When creating widget for the Google Android OS you most likely want to &#8216;push&#8217; updates to the widget as situations have changed or interaction with the widget happend. Let&#8217;s say it possible but you have to be carefull with it. It&#8217;s a fact that battery usage of a mobile device is one of the top [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=102&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://dendirken.files.wordpress.com/2010/05/fu4j6xo68o-android-rendered.jpg"><img class="size-medium wp-image-104 alignleft" title="Android" src="http://dendirken.files.wordpress.com/2010/05/fu4j6xo68o-android-rendered.jpg?w=300&#038;h=187" alt="" width="300" height="187" /></a>When creating widget for the Google Android OS you most likely want to &#8216;push&#8217; updates to the widget as situations have changed or interaction with the widget happend. Let&#8217;s say it possible but you have to be carefull with it. It&#8217;s a fact that battery usage of a mobile device is one of the top priorities a developer has to think about. And on the Android OS wrong programing for a widget could cause a lot of battery to go lost while the developer could have done things just a little different or used more functions from the Android API which would the widget have cause to be more userfriendly and batteryfriendly.</p>
<p><span id="more-102"></span></p>
<h2>Whether or not to update a widget</h2>
<p><a href="http://dendirken.files.wordpress.com/2010/05/android-widget-design-guidelines.png"><img class="alignright size-full wp-image-106" title="Widget Design Guidelines" src="http://dendirken.files.wordpress.com/2010/05/android-widget-design-guidelines.png?w=475" alt=""   /></a>So what are the riks&#8230; For defining the risks of a widget we first have to dive a little into widget development. Upon creating the widget you probably first start the designing of the widget. When that&#8217;s finished two files need to be created. One XML file containing the appwidget-provider-tag and one Java file extending the AppWidgetProvider class, we&#8217;ll just call this the widget provider class.<br />
In the XML file you have to define <em>android:updatePeriodMillis</em>.<br />
The Java file for the widget provider needs to override some methods from it&#8217;s super class. One of the methods is the <em>onUpdate(&#8230;)</em> method. Now what we need to know right here is that the update triggered from the XML configuration always triggers the <em>onUpdate(&#8230;)</em> method from it&#8217;s widget provider class.<br />
Now we know enough to get into troubles. Let&#8217;s say you are creating a very simple widget which just displays the current date and time. For the time we will only show the minutes, not the seconds. At first sight you would set the updatePeriodMilis for the widget to update every minute, so set it to 60.000 milliseconds. The update method from the widget provider class will be called and you will be able to update what the user can see. Although this is where it all goes wrong and lot&#8217;s of unnecessary battery life will be lost. One of the reasons why battery life gets lost is because the <em>updatePeriodMilis</em> will always trigger the display of the device to light up. Not really a good idea if you know that the display is one of the most battery consuming parts of a device. Another reason not to do so is because there will be constantly code being running in the background of the device, imagine that you also want to show the seconds on your simplistic clock? That would almost kill the battery as the devices will never know any rest!</p>
<p>There are better ways to decide to update the widget. In some cases you can just use a button. If the user presses a button, you update the widget, otherwise nothing happens. Off course that&#8217;s not always the use-case you want as you sometimes may want to display let&#8217;s system information. Updates on the wifi status for example. Well there is a solution for these use-cases also! Android provides system updates on the GPS, wifi, clock,&#8230; An application or better an activity can register for updates on those system-services. As soon as there is an update your activity will be warned and you can start updating the widget.</p>
<h2>Updating the content</h2>
<p>So far so good, but there is still something I want to warn you about when it comes to updating the GUI of a widget from within an activity or a service. First off all let&#8217;s have a look at the code to update the layout. Let&#8217;s say we have on the widget three labels available, with the according id&#8217;s of label1, label2 and label3. Not that hard <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<code>RemoteViews rv = new RemoteViews(context.getPackageName(), WIDGET);<br />
rv.setTextViewText(R.id.label1, "the new text");<br />
ComponentName cn = new ComponentName(context, YourActivity.class);<br />
AppWidgetManager mgr = AppWidgetManager.getInstance(context);<br />
mgr.updateAppWidget(cn, rv); </code><br />
Now this should work right out of the box. But what if you want to update more than one label (or button or image or whatever you want to update) at once? You could easily just run the above block of code for 2, 3 or even 4 times. Not a big deal. Although when doing so you might run into problems. Buttons available on the widget might stop working suddenly, just because of using different <em>RemoteViews</em>! The best thing is to do it all in one block of code just like this:<br />
<code>RemoteViews rv = new RemoteViews(context.getPackageName(), WIDGET);<br />
rv.setTextViewText(R.id.label1, "text for label1");<br />
rv.setTextViewText(R.id.label2, "text for label2");<br />
rv.setTextViewText(R.id.label3, "text for label3");<br />
ComponentName cn = new ComponentName(context, YourActivity.class);<br />
AppWidgetManager mgr = AppWidgetManager.getInstance(context);<br />
mgr.updateAppWidget(cn, rv); </code><br />
This block of code shouldn&#8217;t cause any troubles. So remember each time that you want to update your widget to do it all at once, and not in different blocks of code!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dendirken.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dendirken.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dendirken.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dendirken.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dendirken.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dendirken.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dendirken.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dendirken.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dendirken.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dendirken.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dendirken.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dendirken.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dendirken.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dendirken.wordpress.com/102/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=102&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dendirken.wordpress.com/2010/05/29/android-the-danger-of-updating-a-widget/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f7489060ed51ed33938c0cb0d493eb2?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">dendirken</media:title>
		</media:content>

		<media:content url="http://dendirken.files.wordpress.com/2010/05/fu4j6xo68o-android-rendered.jpg?w=300" medium="image">
			<media:title type="html">Android</media:title>
		</media:content>

		<media:content url="http://dendirken.files.wordpress.com/2010/05/android-widget-design-guidelines.png" medium="image">
			<media:title type="html">Widget Design Guidelines</media:title>
		</media:content>
	</item>
		<item>
		<title>Performance in SQL Scripts</title>
		<link>http://dendirken.wordpress.com/2010/04/26/performance-in-sql-scripts/</link>
		<comments>http://dendirken.wordpress.com/2010/04/26/performance-in-sql-scripts/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 12:09:15 +0000</pubDate>
		<dc:creator>Dirk</dc:creator>
				<category><![CDATA[Artikel]]></category>
		<category><![CDATA[RDBMS]]></category>
		<category><![CDATA[Relational Database]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server 2005]]></category>

		<guid isPermaLink="false">http://dendirken.wordpress.com/?p=86</guid>
		<description><![CDATA[I&#8217;m not a big SQL expert myself but a JAVA software engineer. However for my previous project I needed a little more advanced SQL skills for writing a migration plan from an Access database to a Microsoft SQL Server database. In theory this sounds a little weird (who migrates fròm Access&#8230;?) but in fact you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=86&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not a big SQL expert myself but a JAVA software engineer. However for my previous project I needed a little more advanced SQL skills for writing a migration plan from an Access database to a Microsoft SQL Server database. In theory this sounds a little weird (who migrates fròm Access&#8230;?) but in fact you can just import an Access database into MS SQL Server environment. The biggest problem that appeared to me was to migrate about 18.000 records into the MS SQL Server database and do some different actions on it. Copying 18.000 plain records into another database isn&#8217;t that hard until you start using the <em>INSERT-SELECT</em> statements with <em>JOINS</em>.</p>
<p><span id="more-86"></span></p>
<h1>What SQL is&#8230;</h1>
<p>SQL means Structured Query Language and is used to query databases. Using this language it is possible to create, read, update and delete data (also known as the <a title="CRUD operations - Wikipedia" href="http://en.wikipedia.org/wiki/Create,_read,_update_and_delete" target="_blank"><em>CRUD</em></a>-operations) in a database and to retrieve data from it. This language is used to query the most common databases such as Microsoft SQL Server, MySQL, SQLite, DB2,&#8230; (all <em><a title="Relational Databases - Wikipedia" href="http://en.wikipedia.org/wiki/Relational_database" target="_blank">relational databases</a></em>). In <em>relational databases</em>, I assume you all know what that is, you can easily query data from different tables in the same SQL-statement (one CRUD operation). Therefor you will mostlikely use <em>JOIN </em>or <em>WHERE </em>clauses.</p>
<p>I&#8217;ve prepared some easy examples which you should understand before continue to read this article:<br />
A simple insert statement:<br />
<code>INSERT INTO mySimpleTable (column1, column2) VALUES ('1', 'test');</code><br />
Then the syntax of an <em>INSERT-SELECT</em> is:<br />
<code>INSERT INTO mySimpleTable (column1, column2) SELECT mst.column1, mst.column2 FROM mySourceTable mst;</code></p>
<h1>About my problem&#8230;</h1>
<p>Those queries all go nice and smooth but the problems started for me when using <em>JOINS </em>in the <em>FROM</em>-clause. What I always did was something like this:<br />
<code>INSERT INTO mySimpleTable (column1, column2, column3) SELECT FROM sourceTableOne sto LEFT OUTER JOIN sourceTableTwo stt ON sto.id LIKE stt.stoID;<br />
</code>At first this doesn&#8217;t seem to be a very bad query (maybe DB admins already see the problem but I, as a software engineer, didn&#8217;t). What happens here is that this query selects some records from sourceTableOne and the according data from sourceTableTwo. The linkage between two tables is based on the ID of sourceTableOne which is of datatype <em>int</em> or <em>bigint</em>. And there the problems begin. To compare the id and reference ID (FK) with each other I used <em>LIKE</em> all the time. Why? Because like just works for comparing everything (int, bigint, text, ntext, varchar, nvarchar,&#8230;). In my case (with the 18.000 records to query) this statement took more than 30 minutes to execute which slowed down my entire migration process. I had to find a solution to get around this, so why not find the problem first.</p>
<h1>The solution&#8230;</h1>
<p>I just have to admit, altough I don&#8217;t like to praise Microsoft, that SQL Server 2005 Express Edition has a pretty good Query analyzer (or whatever it is officially named). That learned me that it was the <em>JOIN</em> with sourceTableTwo that took this long. So I started playing a bit with the query and noticed that the problem is the <em>LIKE</em> comparator. I used because I wouldn&#8217;t have troubles comparing different data types (integer, varchar, nvarchar,&#8230;) so also in case that the columns had to match exactly I used the <em>LIKE</em> comparator.</p>
<p style="text-align:right;">Little sidenote: The <em>LIKE </em>comparator has been added to SQL so that filtering on a column of which you don&#8217;t exactly know what values it should contain got a lot easier. You could do this with a SQL statement like this: <code>select * from A where myColumn LIKE 'ABC%'</code>. This selects all data from table A where the values in column <em>myColumn</em> start with &#8216;<em>ABC</em>&#8216;.</p>
<p>Altough in SQL the <em>LIKE</em> comparator is much more slower than the equals (=) comparator. Replacing <em>LIKE </em>with the equals (=) symbol it only takes me 3 seconds to execute that exact same query.</p>
<h1>And yet another problem&#8230; and solution!</h1>
<p>Now let&#8217;s extend the query which runs in about 3 seconds with a subquery:<br />
<code>INSERT INTO mySimpleTable (column1, column2, column3) SELECT  FROM sourceTableOne sto LEFT OUTER JOIN sourceTableTwo stt ON sto.id = stt.stoID<strong> WHERE sto.id IN (SELECT id FROM sourceTableOne WHERE value1 &gt; 10);</strong></code></p>
<p>Again this query runs way much longer than 3 seconds just by adding an extra subselect.  You could replace this query with a <em>HAVING</em> subquery, which would seriously improve performance.<br />
<code>INSERT INTO mySimpleTable (column1, column2, column3) SELECT  FROM sourceTableOne sto LEFT OUTER JOIN sourceTableTwo stt ON sto.id LIKE stt.stoID WHERE sto.id <strong>HAVING (SELECT * FROM sourceTableOne WHERE value1 &gt; 10 AND id LIKE sto.id);</strong></code></p>
<h1>Conclusion</h1>
<p>So pay attention to following two points in writing queries that handle a massive load of data:</p>
<ul>
<li>For an exact match in a <em>JOIN </em>or <em>WHERE </em>clause always use the equals symbol (=) and <strong>not </strong><em>LIKE</em></li>
<li>Searching for a value in a list <strong>don&#8217;t use </strong><em><strong>IN</strong></em> but instead try <em><strong>HAVING</strong></em></li>
</ul>
<p>But also know the equals symbol (=) can be used for comparing most fields, even with different data types, for example <em>integer </em>and <em>varchar</em>. , but not for all. Not for <em>text</em> and <em>ntext</em>!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dendirken.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dendirken.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dendirken.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dendirken.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dendirken.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dendirken.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dendirken.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dendirken.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dendirken.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dendirken.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dendirken.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dendirken.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dendirken.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dendirken.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=86&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dendirken.wordpress.com/2010/04/26/performance-in-sql-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f7489060ed51ed33938c0cb0d493eb2?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">dendirken</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu 10.04 &#8211; Lucid Lynx (Coming&#8230;)</title>
		<link>http://dendirken.wordpress.com/2010/04/26/ubuntu-10-04-lucid-lynx-coming/</link>
		<comments>http://dendirken.wordpress.com/2010/04/26/ubuntu-10-04-lucid-lynx-coming/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 06:56:27 +0000</pubDate>
		<dc:creator>Dirk</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[LTS]]></category>
		<category><![CDATA[Lucid Lynx]]></category>

		<guid isPermaLink="false">http://dendirken.wordpress.com/?p=93</guid>
		<description><![CDATA[On Thursday april 29th Ubuntu 10.04, aka Lucid Lynx, will be released. This release will be, again, an LTS (Long Term Support) release.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=93&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ubuntu.com/"><img src="http://www.ubuntu.com/files/countdown/static.png" width="180" height="150" alt="Ubuntu: For Desktops, Servers, Netbooks and in the cloud" border="0" /></a><br />
On Thursday april 29th Ubuntu 10.04, aka Lucid Lynx, will be released. This release will be, again, an LTS (Long Term Support) release.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dendirken.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dendirken.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dendirken.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dendirken.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dendirken.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dendirken.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dendirken.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dendirken.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dendirken.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dendirken.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dendirken.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dendirken.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dendirken.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dendirken.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=93&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dendirken.wordpress.com/2010/04/26/ubuntu-10-04-lucid-lynx-coming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f7489060ed51ed33938c0cb0d493eb2?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">dendirken</media:title>
		</media:content>

		<media:content url="http://www.ubuntu.com/files/countdown/static.png" medium="image">
			<media:title type="html">Ubuntu: For Desktops, Servers, Netbooks and in the cloud</media:title>
		</media:content>
	</item>
		<item>
		<title>Mobile Development</title>
		<link>http://dendirken.wordpress.com/2010/01/02/myepisodes-watch-list/</link>
		<comments>http://dendirken.wordpress.com/2010/01/02/myepisodes-watch-list/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 14:34:45 +0000</pubDate>
		<dc:creator>Dirk</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Artikel]]></category>
		<category><![CDATA[Android Market]]></category>
		<category><![CDATA[black berry]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google code]]></category>
		<category><![CDATA[GSM]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[myepisodes.com]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[Smartphone]]></category>
		<category><![CDATA[Symbian]]></category>

		<guid isPermaLink="false">http://dendirken.wordpress.com/?p=81</guid>
		<description><![CDATA[Enige tijd terug vond ik de weg naar Android. Dit is een gratis Linux gebasseerd besturingssysteem voor GSM of meerbepaald smartphones, ontwikkeld door Google. Het Android besturingssysteem in combinatie met de Android-geladen toestellen moeten als volwaardige concurrent kunnen dienen tegen de iPhone. Het grote voordeel dat Android heeft is dat de aankop van een Android-toestel [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=81&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Enige tijd terug vond ik de weg naar Android. Dit is een gratis Linux gebasseerd besturingssysteem voor GSM of meerbepaald smartphones, ontwikkeld door Google. Het Android besturingssysteem in combinatie met de Android-geladen toestellen moeten als volwaardige concurrent kunnen dienen tegen de iPhone. Het grote voordeel dat Android heeft is dat de aankop van een Android-toestel goedkoper is (omdat je in principe enkel voor het toestel betaald en niet het besturingssysteem) en er meer (percentueel gezien) gratis applicaties in de aanbieding zijn. Ook krijg je als Android gebruiker op regelmatige tijdstippen updates naar nieuwe versies van het besturingssysteem.</p>
<p><a href="http://dendirken.files.wordpress.com/2010/01/google-android-phone.jpg"><img class="aligncenter size-medium wp-image-82" title="google-android-phone" src="http://dendirken.files.wordpress.com/2010/01/google-android-phone.jpg?w=300&#038;h=193" alt="" width="300" height="193" /></a><span id="more-81"></span>Applicatie ontwikkeling op Android staat nog min of meer in zijn kinderschoenen gezien de jonge leeftijd van Android maar wordt wel perfect ondersteund door Google. Zo ben ik zelf aan de slag gegaan om in Java een eigen applicatie te bouwen. &#8216;MyEpisode Watch List&#8217; is de naam van de applicatie en is sinds een week gratis te verkrijgen op de Android Market. MyEpisodes.com is een website waar je gratis kan registreren en zo een lijst bijhouden van welke afleveringen van bepaalde series je nog moet downloaden/bekijken. Deze mobiele applicatie haalt een lijst op van alle nog te bekijken afleveringen en als je één van bekeken hebt kan je ze meteen markeren als &#8216;bekeken&#8217;. De status van elke episode wordt geupdated op MyEpisodes.com telkens bij het veranderen van een status naar &#8216;bekeken&#8217;. De applicatie is momenteel enkel beschikbaar met een Engelstalige layout maar in de toekomst komt daar zeker nog een Nederlandstalige layout voor!</p>
<p>Een super groot success kan je applicatie niet noemen (en dat had ik persoonlijk ook nooit verwacht). Maar als geregistreerd Android developper kan je nagaan hoeveel mensen je applicatie ooit geïnstalleerd hebben en hoeveel mensen er actief gebruik van maken. Tot mijn grote verbazing (ik had al blij geweest had ik er op één week tijd 100 downloads en wat minder actieve gebruikers gehad) hebben reeds 199 mensen de applicatie gedownload en heb ik momenteel 102 actieve gebruikers van de applicatie.</p>
<p><em>Mobile development is the future of application development.</em> Dat is mijn standpunt tegenover applicatie ontwikkeling. Smartphones zoals de iPhones, Palm, Android,Symbian,&#8230; krijgen steeds een groter marktaandeel in de mobiele communicatie markt. Dat grotere aandeel in combinatie met de steeds groter wordende mogelijkheden op zo&#8217;n toestel maakt dat we er binnenkort alles kunnen op doen en dat bedrijven Smartphones ook kunnen gaan gebruiken om bepaalde van hun business problemen op te lossen.<br />
<em>But no mobile development without the good-old application development.</em> Computers zullen echter nooit te vervangen zijn door Smartphones en application development is daarom zeker en vast niet dood. Er is al lang een markt voor mobile development maar deze markt wordt nu steeds sneller groter en groter en dat maakt dat het nu het ogenblik is dat er moet ingespeeld worden op een extra markt.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dendirken.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dendirken.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dendirken.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dendirken.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dendirken.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dendirken.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dendirken.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dendirken.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dendirken.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dendirken.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dendirken.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dendirken.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dendirken.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dendirken.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=81&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dendirken.wordpress.com/2010/01/02/myepisodes-watch-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f7489060ed51ed33938c0cb0d493eb2?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">dendirken</media:title>
		</media:content>

		<media:content url="http://dendirken.files.wordpress.com/2010/01/google-android-phone.jpg?w=300" medium="image">
			<media:title type="html">google-android-phone</media:title>
		</media:content>
	</item>
		<item>
		<title>10/GUI oftewel weg met de (computer)muis</title>
		<link>http://dendirken.wordpress.com/2009/10/17/10gui-oftewel-weg-met-de-computermuis/</link>
		<comments>http://dendirken.wordpress.com/2009/10/17/10gui-oftewel-weg-met-de-computermuis/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 14:56:39 +0000</pubDate>
		<dc:creator>Dirk</dc:creator>
				<category><![CDATA[Artikel]]></category>
		<category><![CDATA[10/GUI]]></category>
		<category><![CDATA[device]]></category>
		<category><![CDATA[Douglas Engelbart]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[muis]]></category>
		<category><![CDATA[touchscreen]]></category>
		<category><![CDATA[user interface]]></category>

		<guid isPermaLink="false">http://dendirken.wordpress.com/?p=75</guid>
		<description><![CDATA[De uitvinding van de (computer)muis (1964) staat officieel op de naam van Douglas Engelbart (foto links). Sindsdien heeft het essentiele input-aparaat voor computers een lange weg afgelegd. Van een oude zwarte, lelijk uitziende doos met harde knoppen en een draad naar stijlvolle designs zonder draad. Hoe makkelijk een muis ook kan zijn, toch zijn er [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=75&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-76" title="Douglas Engelbart" src="http://dendirken.files.wordpress.com/2009/10/screenshot7.png?w=123&#038;h=150" alt="Douglas Engelbart" width="123" height="150" />De uitvinding van de (computer)muis (1964) staat officieel op de naam van Douglas Engelbart (foto links). Sindsdien heeft het essentiele input-aparaat voor computers een lange weg afgelegd. Van een oude zwarte, lelijk uitziende doos met harde knoppen en een draad naar stijlvolle designs zonder draad. Hoe makkelijk een muis ook kan zijn, toch zijn er een aantal beperkingen. Met de muis kan je namelijk maar op één plaats tegelijk op het scherm zijn (single point of interaction) en dat beperkt het gebruikersgemak. Een betere oplossing zou zijn om met touchscreens te werken waarbij de gebruiker van zijn beide handen optimaal gebruik kan maken. Maar&#8230; Ergonomie is enorm belangrijk geworden in het ontwikkelen van user-input hardware. Steeds met je arm de lucht in om op een scherm te kunnen tokkelen is alles behalve ergnomisch. Een tweede probleem aan deze oplossing is dat je handen de zichtbaarheid van het scherm beperken. Je kan dan inderdaad meer werken maar wordt gestoord door je handen die in de weg zitten. En daar komt 10/GUI met een oplossing.<span id="more-75"></span></p>
<p style="text-align:center;"><img class="size-full wp-image-77 aligncenter" title="10/GUI Concept" src="http://dendirken.files.wordpress.com/2009/10/screenshot8.png?w=475" alt="10/GUI Concept"   /></p>
<p>Om makkelijker te werken en gebruik te kunnen maken van alle tien je vingers komt 10/GUI met het idee af om niet enkel de muis in de vuilbak te smijten maar zelfs volledig af te stappen van het werken met venster die elkaar kunnen overlappen, kunnen worden versleept,&#8230; Wat 10/GUI in zijn <a title="10/GUI Video" href="http://10gui.com/video/" target="_blank">video</a> voorstelt is om te werken met een soort van touch plate waar je handen opliggen en waarmee je de computer bedient. De vingertoppen die het oppervlak raken worden dan op het scherm als kleine cirkels. Zo win je qua zichtbaarheid de oppervlakte die anders door de handpalmen wordt bedekt en heb je meer bereik op het scherm dan met een muis. Daarnaast werkt 10/GUI niet met de venster zoals deze gekend zijn in onze huidige besturingssystemen maar met venster die altijd de volledige hoogte van je scherm bedeken, en slecht een gedeelte van de breedte. Bij het openen van een tweede scherm komt dit er niet over te staan maar ernaast. Door gebruik te maken van al je vingers kan je dan door de horizontale lijst scrollen, vensters selecteren en vensters verplaatsen. Voor het werken in een programma maakt het ook niet uit welke vinger(s) je gebruikt om bijvoorbeeld een menu te openen. De vinger die het dichtste bij is gebruik je gewoon om naar de plaats op het scherm te gaan waar dit nodig is. Het demo filmpje is zeker de moeite waard om een te bekijken. Ik geloof zelfs dat hier potentieel in zit.</p>
<p>Of de muis door deze nieuwe technologie volledig afgedaan zou hebben is maar zeer de vraag. Het gebruik van een 10/GUI systeem lijkt op het eerste zicht heel handig en ik geloof er ook in dat dit ook zo is. Maar stel je voor met een laptop dat je (ipv van je muis) steeds een soort van touch plate moet meeslepen zoals het voorbeeld ook wordt gegeven in de video. Makkelijk is zeker anders. Stel dat deze technologie ooit aanslaat zal de muis wel blijven bestaan. 10/GUI zal zich vooral focussen op desktop gebruikers in plaats van laptop gebruikers.</p>
<span style="text-align:center; display: block;"><a href="http://dendirken.wordpress.com/2009/10/17/10gui-oftewel-weg-met-de-computermuis/"><img src="http://img.youtube.com/vi/zWz1KbknIZk/2.jpg" alt="" /></a></span>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dendirken.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dendirken.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dendirken.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dendirken.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dendirken.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dendirken.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dendirken.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dendirken.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dendirken.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dendirken.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dendirken.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dendirken.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dendirken.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dendirken.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dendirken.wordpress.com&amp;blog=9840717&amp;post=75&amp;subd=dendirken&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dendirken.wordpress.com/2009/10/17/10gui-oftewel-weg-met-de-computermuis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f7489060ed51ed33938c0cb0d493eb2?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">dendirken</media:title>
		</media:content>

		<media:content url="http://dendirken.files.wordpress.com/2009/10/screenshot7.png?w=123" medium="image">
			<media:title type="html">Douglas Engelbart</media:title>
		</media:content>

		<media:content url="http://dendirken.files.wordpress.com/2009/10/screenshot8.png" medium="image">
			<media:title type="html">10/GUI Concept</media:title>
		</media:content>
	</item>
	</channel>
</rss>
