<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bart Leemans</title>
	<atom:link href="http://www.dotred.be/bart/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotred.be/bart</link>
	<description>Webdevelopment and Google Android</description>
	<lastBuildDate>Sat, 12 May 2012 13:12:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Twitter searchtool</title>
		<link>http://www.dotred.be/bart/2012/04/07/twitter-searchtool/</link>
		<comments>http://www.dotred.be/bart/2012/04/07/twitter-searchtool/#comments</comments>
		<pubDate>Sat, 07 Apr 2012 20:24:42 +0000</pubDate>
		<dc:creator>bart</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[social media]]></category>
		<category><![CDATA[webdevelopment]]></category>

		<guid isPermaLink="false">http://www.dotred.be/bart/?p=258</guid>
		<description><![CDATA[I&#8217;ve been playing with the Twitter API to create a little tool to list tweets based on a given searchstring. The result is a webapp which makes it able to search tweets based on a given searchstring, a given hashtag or a given username. I plan to add more functionality later on, but you can [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing with the Twitter API to create a little tool to list tweets based on a given searchstring.<br />
The result is a webapp which makes it able to search tweets based on a given searchstring, a given hashtag or a given username.</p>
<p><a href="http://www.dotred.be/bart/wp-content/uploads/2012/04/screen.png"><img class="alignnone size-medium wp-image-263" title="screen" src="http://www.dotred.be/bart/wp-content/uploads/2012/04/screen-300x244.png" alt="" width="300" height="244" /></a><br />
I plan to add more functionality later on, but you can try out the current version in <a title="Dotred twtr 0.1 download" href="http://www.dotred.be/bart/wp-content/uploads/2012/04/dotred-twtr0.1.zip">this download</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dotred.be/bart/2012/04/07/twitter-searchtool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jquery tips &amp; tricks</title>
		<link>http://www.dotred.be/bart/2012/03/09/jquery-tips-tricks/</link>
		<comments>http://www.dotred.be/bart/2012/03/09/jquery-tips-tricks/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 14:51:48 +0000</pubDate>
		<dc:creator>bart</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[webdevelopment]]></category>

		<guid isPermaLink="false">http://www.dotred.be/bart/?p=250</guid>
		<description><![CDATA[If you are a webdeveloper, the chance is big you have used JQuery to fancy up youw website or webapplication. JQuery is &#8211; in my humble opinion &#8211; awesome and very powerful to use. Below, I summarized some handy tips and tricks to make it more easy to use! 1. First of all, when using [...]]]></description>
			<content:encoded><![CDATA[<p>If you are a webdeveloper, the chance is big you have used JQuery to fancy up youw website or webapplication.<br />
JQuery is &#8211; in my humble opinion &#8211; awesome and very powerful to use.<br />
Below, I summarized some handy tips and tricks to make it more easy to use!</p>
<p>1. First of all, when using JQuery, you often see the use of</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
</pre>
<pre>$(document).ready(function() {
//some code here
});</pre>
</div>
<p>OR</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
</pre>
<pre>$(function() {
//some code here
});</pre>
</div>
<p>to start writing JQuery, but which one should you use? Is there any difference? Well, there isn&#8217;t any, both methods are equal.</p>
<p>2. Link JQuery in your webpage with fallback<br />
When using JQuery, you have to link in the js-library to your webpage.<br />
To do this, you can make a reference to an external link, but if you do so, it&#8217;s a good idea to create a fallback in case the link is broken, you do this with the following two lines:</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
</pre>
<pre>&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;!window.jQuery &amp;&amp; document.write(&#039;&lt;script src=&quot;js/jquery-1.7.1.min.js&quot;&gt;&lt;\/script&gt;&#039;)&lt;/script&gt;</pre>
</div>
<p>3. Access even or odd rows in a collection of elements<br />
For a better layout, it maybe would come in handy to style even or odd rows in perhaps a table.<br />
You can achieve this with the following code:</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre>$(&quot;tr:even&quot;).css(&quot;background-color&quot;, &quot;#C0C0C0&quot;);</pre>
</div>
<p>4. Access all child elements of a parent element</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre>$(&quot;#divContainer &gt; div&quot;).css(&quot;background-color&quot;, &quot;#D0D0D0&quot;);</pre>
</div>
<p>5. Don&#8217;t write too much code!<br />
JQuery stands for write less, do more, so you can achieve things with a minimum of code.<br />
An example of this is to add a mouseover effect:</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
</pre>
<pre>$(&quot;#linkDiv a&quot;).hover(function () {
$(this).toggleClass(&quot;markLink&quot;);
});</pre>
</div>
<p>In the above code you see that there is no need to implement the mouseover and mouseout to add and temove the class, you can simply use toggleClass to achieve the same with less code.</p>
<p>6. Use &#8220;find&#8221; for better performance</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre>$(&#039;#searchDiv&#039;).find(&#039;p.innerP&#039;).hide();</pre>
</div>
<p>7. Perform an action on all elements in a parent element with just one line of code.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre>$(&#039;.theClass&#039;, &#039;#theContainer&#039;).hide();</pre>
</div>
<p>This piece of code hides all elements with class .theClass in theContainer</p>
<p>Do you have any tips or suggestions, improvements or remarks? Please let me know and I will add the info on this page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dotred.be/bart/2012/03/09/jquery-tips-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Menu: some changes</title>
		<link>http://www.dotred.be/bart/2012/01/31/android-menu-some-changes/</link>
		<comments>http://www.dotred.be/bart/2012/01/31/android-menu-some-changes/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 18:27:25 +0000</pubDate>
		<dc:creator>bart</dc:creator>
				<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://www.dotred.be/bart/?p=244</guid>
		<description><![CDATA[Some of you may have noticed that newer Android smartphones lack a menu-button. Even my new Galaxy Nexus doesn&#8217;t have one. Now, Google announced that they want to stimulate the use of the Action Bar and get rid of the menu-button. With the action bar, actions are directly displayed on top of the screen so [...]]]></description>
			<content:encoded><![CDATA[<p>Some of you may have noticed that newer Android smartphones lack a menu-button.<br />
Even my new Galaxy Nexus doesn&#8217;t have one.<br />
Now, Google announced that they want to stimulate the use of the Action Bar and get rid of the menu-button.<br />
With the action bar, actions are directly displayed on top of the screen so you can call direct actions in your app.<br />
If you still use the menu, an icon with three docs centered vertically will be displayed and show the menu items when you touch this button.</p>
<p>I strongly advise you to start using this method, but don&#8217;t panic, lot&#8217;s of apps (including some of my apps) still use the menu button and it&#8217; still supported<br />
in the new Android OS.</p>
<p><img src="http://developer.android.com/images/ui/actionbar.png" alt="android action bar" /></p>
<p>How to?<br />
To find the guidelines and official documentation on this issue, you can go to the official pages: http://developer.android.com/guide/topics/ui/actionbar.html<br />
In this little tutorial, I will explain how you can change to the new menu in just a few steps so you can get started.</p>
<p><strong>Step 1: modify your manifest.xml</strong><br />
First of all, you need to tell your app that it targets for an sdk with this new featere, as from Android 3.0, the action bar is included in all activities using the Theme.Hole theme.<br />
Because this is API level 11, you can add something like this to your manifest:</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
</pre>
<pre>&lt;uses-sdk android:minSdkVersion=&quot;4&quot;
android:targetSdkVersion=&quot;11&quot; /&gt;</pre>
</div>
<p>You can add this directly under the manifest-tag.</p>
<p><strong>Step 2: create the menu</strong><br />
When creating your menu, you likely use the onCreateOptionsMenu method to set up a menu, this remains te same:</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
</pre>
<pre>@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.mymenu, menu);
return true;
}</pre>
</div>
<p>Because R.menu.mymenu refers to an xml resource, you have to make a little change to this document.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
</pre>
<pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;menu xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
&lt;item android:id=&quot;@+id/menu_add&quot;
android:icon=&quot;@drawable/ic_menu_add&quot;
android:title=&quot;@string/menu_add&quot;
android:showAsAction=&quot;ifRoom|withText&quot; /&gt;
&lt;/menu&gt;</pre>
</div>
<p>The first three lines will look familiar, what has ben added is the showAsAction, this makes sure that the item will be displayed in the optionsmenu when there is room available (ifRoom).<br />
If there&#8217;s not enough room, an overflow menu will appear (icon with three dots vertically aligned) and the items will be listed there.<br />
Always make sure you add the title for a menu item, screen readers make use of them and the overflow menu only displays the titles, also a longpress on an icon shows the tooltip based on the title of the item.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dotred.be/bart/2012/01/31/android-menu-some-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JQuery tagcloud</title>
		<link>http://www.dotred.be/bart/2012/01/22/jquery-tagcloud/</link>
		<comments>http://www.dotred.be/bart/2012/01/22/jquery-tagcloud/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 17:13:06 +0000</pubDate>
		<dc:creator>bart</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[webdevelopment]]></category>

		<guid isPermaLink="false">http://www.dotred.be/bart/?p=238</guid>
		<description><![CDATA[I have been making a little tagcloud to display in a webpage using JQuery. The script generates given links in a container. You can download the script here.]]></description>
			<content:encoded><![CDATA[<p>I have been making a little tagcloud to display in a webpage using JQuery.<br />
The script generates given links in a container.</p>
<p><img src="http://www.dotred.be/bart/wp-content/uploads/2012/01/tagcloud.png" width="300" alt="tagcloud" /><br />
You can download the script <a title="Jquery Tagcloud" href="http://www.dotred.be/bart/wp-content/uploads/2012/01/dotred-tagcloud.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dotred.be/bart/2012/01/22/jquery-tagcloud/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jquery : dialog form with validation</title>
		<link>http://www.dotred.be/bart/2011/10/27/jquery-dialog-form-with-validation/</link>
		<comments>http://www.dotred.be/bart/2011/10/27/jquery-dialog-form-with-validation/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 18:49:23 +0000</pubDate>
		<dc:creator>bart</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery ui]]></category>
		<category><![CDATA[webdevelopment]]></category>

		<guid isPermaLink="false">http://www.dotred.be/bart/?p=213</guid>
		<description><![CDATA[Jquery can be very useful for live validation in a form so the user get&#8217;s direct input when errors are made. Today, I experimented with JQuery Dialog to show a beautiful contactform in a smooth popup. Eventually, I combined the two together, the result is the code below which shows a nice popupform with jquery [...]]]></description>
			<content:encoded><![CDATA[<p>Jquery can be very useful for live validation in a form so the user get&#8217;s direct input when errors are made.</p>
<p>Today, I experimented with JQuery Dialog to show a beautiful contactform in a smooth popup.<br />
Eventually, I combined the two together, the result is the code below which shows a nice popupform with jquery live validation.<br />
<span id="more-213"></span><br />
You can add the markup you wanted in the css class I created.</p>
<p>You can find the validation plugin at <a title="Jquery validate plugin" href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" target="_blank">http://bassistance.de/jquery-plugins/jquery-plugin-validation/<br />
</a></p>
<p>The Dialog plugin can be found at<a title="Jquery validate plugin" href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" target="_blank"> http://docs.jquery.com/UI/Dialog</a></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
</pre>
<pre>&lt;!--
/**
 * dotred jquery dialog with validation (http://www.dotred.be)
 *
 * This script shows a JQuery dialog with validation and Ajax submit.
 *
 * Version 1.0
 *
 * 27 October 2011
 *
 * Copyright (c) 2011 Dotred, Bart Leemans
 * Licensed under the GPL licenses.
 * http://www.gnu.org/licenses/gpl.txt
 **/
 --&gt;
&lt;html&gt;
&lt;head&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css&quot;&gt;
&lt;style type=&quot;text/css&quot;&gt;
	.contactDialog{
		/*put your markup here*/
	}
&lt;/style&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery.validate.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function() {
	$(&#039;#opener&#039;).click(function() {
		$(&quot;#divContact&quot;).dialog({
			autoOpen: true,
			title: &#039;Contact&#039;,
			dialogClass: &#039;contactDialog&#039;,
			height:250,
			width:350,
			buttons: {
			  &#039;Send&#039;: function() {
									if ($(&quot;#frmContact&quot;).validate().form() == true) {
										sendContactForm($(this).find(&#039;form&#039;));
									}
								},
			  &#039;Cancel&#039;: function() {$(this).dialog(&#039;close&#039;);}
			}
		});
	});
});
function sendContactForm(form) {
    form = $(form);
    $.ajax({
        beforeSend: function(data) {
            form.validate();
        },
        url: form.attr(&#039;action&#039;),
        data: form.serialize(),
        type: (form.attr(&#039;method&#039;)),
        dataType: &#039;text&#039;,
        error: function(data) {
            $(&#039;#divOutput&#039;).html(data);
        },
        success: function(data) {
            $(&#039;#divOutput&#039;).html(data);
        }
    });
  return false;
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;button id=&quot;opener&quot;&gt;Click!&lt;/button&gt;
&lt;br /&gt;
&lt;div id=&quot;divContact&quot; style=&quot;display:none;&quot;&gt;
	&lt;form method=&quot;post&quot; action=&quot;contact.php&quot; id=&quot;frmContact&quot;&gt;
		&lt;input type=&quot;text&quot; name=&quot;naam&quot; class=&quot;required&quot; /&gt;
	&lt;/form&gt;
&lt;/div&gt;
&lt;div id=&quot;divOutput&quot;&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.dotred.be/bart/2011/10/27/jquery-dialog-form-with-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SEO keywords generator</title>
		<link>http://www.dotred.be/bart/2011/10/05/seo-keywords-generator/</link>
		<comments>http://www.dotred.be/bart/2011/10/05/seo-keywords-generator/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 19:40:58 +0000</pubDate>
		<dc:creator>bart</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.dotred.be/bart/?p=210</guid>
		<description><![CDATA[I&#8217;ve been trying to make a little script that listst the occurences of words in a text so you can check if important terms are well represented to improve search engine results. In wordsIgnorelist array, you can add words you want to ignore from te results. 1 2 3 4 5 6 7 8 9 [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been trying to make a little script that listst the occurences of words in a text so you can check if important terms are well represented to improve search engine results.<br />
In wordsIgnorelist array, you can add words you want to ignore from te results.<br />
 <span id="more-210"></span></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
</pre>
<pre>&lt;html&gt;
&lt;head&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
function validate(){
	//wordlist: outcomment the desired language, dutch and english are supported
	//dutch

	//var wordsIgnorelist = new Array(&quot;de&quot;,&quot;het&quot;,&quot;een&quot;,&quot;te&quot;,&quot;aan&quot;,&quot;voor&quot;,&quot;op&quot;);
	//english
	var wordsIgnorelist = new Array(&quot;a&quot;,&quot;the&quot;,&quot;for&quot;,&quot;to&quot;,&quot;on&quot;,&quot;at&quot;);
	//get the text
	var text = document.frmvalidate.thetext.value;
	if(text == &quot;&quot;){
		alert(&quot;nothing to validate!&quot;);
	}else{
		//split text in wordts by space
		var words = text.split(&quot; &quot;);
		//filter out invalid words
		for(var i=0; i &lt; words.length; i++) {
			if(words[i].length &lt; 2){
				words.splice(i,1);
			}

			for(var j = 0;j &lt; wordsIgnorelist.length;j++){
				if(words[i] == wordsIgnorelist[j]){
					words.splice(i,1);
				}
			}
		}

		//loop words
		var uniqueWords = new Array();
		var found = false;
		for(var i=0; i  &lt; words.length; i++) {
			for (var j = 0; j &lt; uniqueWords.length; j++) {
				if(uniqueWords[j][0] == words[i]){
					found = true;
					break;
				}
			}
			if(found == false){
				var tmpA=new Array();
				tmpA[0]=words[i];
				tmpA[1]=1;
				uniqueWords[uniqueWords.length] = tmpA;
			}else{
				uniqueWords[j][1] = parseInt(uniqueWords[j][1] + 1);
			}
			found = false;
		}
		var resultString = &quot;&quot;;
		for (var i = 0; i &lt; uniqueWords.length;i++){
			resultString = resultString + uniqueWords[i][0] + &quot; : &quot; + uniqueWords[i][1] + &quot;\n&quot;;
		}
		document.frmvalidate.result.value = resultString;
	}
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;form name=&quot;frmvalidate&quot;&gt;
		&lt;textarea name=&quot;thetext&quot; rows=&quot;5&quot; cols=&quot;50&quot;&gt;&lt;/textarea&gt;
		&lt;textarea name=&quot;result&quot; rows=&quot;5&quot; cols=&quot;50&quot;&gt;&lt;/textarea&gt;
		&lt;input type=&quot;button&quot; onclick=&quot;validate();&quot; value=&quot;calculate!&quot;&gt;
	&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.dotred.be/bart/2011/10/05/seo-keywords-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android activities and subactivities</title>
		<link>http://www.dotred.be/bart/2011/10/02/android-activities-and-subactivities/</link>
		<comments>http://www.dotred.be/bart/2011/10/02/android-activities-and-subactivities/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 12:48:54 +0000</pubDate>
		<dc:creator>bart</dc:creator>
				<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://www.dotred.be/bart/?p=200</guid>
		<description><![CDATA[If you are developing an Android application, the chance is big that you will call other activities that require a response to your main form. For example: if you have a main activity that lists notes and you call a new activity called AddNote to input a new note. The main form needs to know [...]]]></description>
			<content:encoded><![CDATA[<p>If you are developing an Android application, the chance is big that you will call other activities that require a response to your main form.</p>
<p>For example: if you have a main activity that lists notes and you call a new activity called AddNote to input a new note.<br />
The main form needs to know if the add of the new note succeeded because it&#8217;s also possible the user pushed cancel.<br />
Also, you want the main activity to know if the list with notes has to be refreshed, you absolutely don&#8217;t want to call your main activity from your subactivity after a succesfull add because this will mess up your activity lifecycle and your main activity will be opened twice.</p>
<p>Normally you would call an Activity like this:</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre>intent launchActivity = new Intent(this,yourclassname.class);</pre>
</div>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre>startActivity(launchActivity);</pre>
</div>
<p>Optionally, if you want the current class to close, you can call</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre>finish();</pre>
</div>
<p>Instead of this, we launch an Activity and wait for its result, with this we send a unique identifier as an integer:</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre>Intent  launchActivity = new Intent(this,yourclassname.class);</pre>
</div>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre>startActivityForResult(lauchActivity,REQUEST_ID);</pre>
</div>
<p>In the subactivity, we can set the result response to the mainactivity.<br />
Say, for example, the save of a note was successfull, you can write:</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre>setResult(RESULT_OK,null);</pre>
</div>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre>finish();</pre>
</div>
<p>This will let the mainactivity know the result of it&#8217;s purpose has succeeded and close the subactivity.</p>
<p>In your mainactivity you can check if a result has been sent from the subactivity by the following code:</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
</pre>
<pre>protected void onActivityResult(int requestCode,int resultCode,Intent data){
if(requestCode == REQUEST_ID){
if(resultCode == RESULT_OK){
//do something - for example: refresh your itemslist
}
}
}</pre>
</div>
<p>More information on Activities can be found at <a title="Android activities" href="http://developer.android.com/reference/android/app/Activity.html" target="_blank">http://developer.android.com/reference/android/app/Activity.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dotred.be/bart/2011/10/02/android-activities-and-subactivities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript slideshow with fade</title>
		<link>http://www.dotred.be/bart/2011/06/25/javascript-slideshow-with-fade/</link>
		<comments>http://www.dotred.be/bart/2011/06/25/javascript-slideshow-with-fade/#comments</comments>
		<pubDate>Sat, 25 Jun 2011 08:32:37 +0000</pubDate>
		<dc:creator>bart</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[webdevelopment]]></category>

		<guid isPermaLink="false">http://www.dotred.be/bart/?p=187</guid>
		<description><![CDATA[Nowadays, there are some nice frameworks available to get amazing effects for your images on your website. However, maybe you don&#8217;t want to use a framework. Therefore, I created a JavaScript slideshowscript that shows images with a description with a fading effect. The script has been tested with Mozilla Firefox 5, Google Chrome 12.0.742.100 and [...]]]></description>
			<content:encoded><![CDATA[<p>Nowadays, there are some nice frameworks available to get amazing effects for your images on your website.<br />
However, maybe you don&#8217;t want to use a framework.<br />
Therefore, I created a JavaScript slideshowscript that shows images with a description with a fading effect.</p>
<p>The script has been tested with Mozilla Firefox 5, Google Chrome 12.0.742.100 and Safari 5.0.3</p>
<p>You can download it <a title="Javascript slideshow with fade" href="http://www.dotred.be/bart/wp-content/uploads/2011/06/dotred-slideshow-fade.zip">here</a>, it is free to use under the MIT Licence included in the script.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dotred.be/bart/2011/06/25/javascript-slideshow-with-fade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My first Android app</title>
		<link>http://www.dotred.be/bart/2011/06/18/my-first-android-app/</link>
		<comments>http://www.dotred.be/bart/2011/06/18/my-first-android-app/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 22:48:48 +0000</pubDate>
		<dc:creator>bart</dc:creator>
				<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://www.dotred.be/bart/?p=184</guid>
		<description><![CDATA[This week I wrote my first Android app. I have created it for the visitors of my website carspotting.be in Dutch so they can read the latest news and see the latest spots on their smartphone. You can find it at the Android Market.]]></description>
			<content:encoded><![CDATA[<p>This week I wrote my first Android app.<br />
I have created it for the visitors of my website carspotting.be in Dutch so they can read the latest news and see the latest spots on their smartphone.</p>
<p>You can find it at the <a href="https://market.android.com/details?id=com.carspotting&amp;feature=search_result">Android Market</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dotred.be/bart/2011/06/18/my-first-android-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>To www or not to www</title>
		<link>http://www.dotred.be/bart/2011/04/30/to-www-or-not-to-www/</link>
		<comments>http://www.dotred.be/bart/2011/04/30/to-www-or-not-to-www/#comments</comments>
		<pubDate>Sat, 30 Apr 2011 13:35:11 +0000</pubDate>
		<dc:creator>bart</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[webdevelopment]]></category>

		<guid isPermaLink="false">http://www.dotred.be/bart/?p=176</guid>
		<description><![CDATA[A website url isn&#8217;t always what it seems. If you go to a website like for example http://www.mywebsite.com and you have to login to access the website, you will notice that when you remove the www from the address, your session will be gone. This is because a lot of webbrowsers don&#8217;t recognize it as [...]]]></description>
			<content:encoded><![CDATA[<p>A website url isn&#8217;t always what it seems.</p>
<p>If you go to a website like for example http://www.mywebsite.com and you have to login to access the website, you will notice that when you remove the www from the address, your session will be gone.<br />
<span id="more-176"></span></p>
<p>This is because a lot of webbrowsers don&#8217;t recognize it as the same website.</p>
<p>Also, believe it or not, some search engines wil index these two url&#8217;s as two different websites.<br />
So, to avoid duplicate content penalities and sessionproblems, maybe you want to consider to make your website resistent to this confusion.</p>
<p>There are a few ways to do this. The way I use is to modify your .htaccess file to make your webserver add a www when it is not typed by the user.</p>
<p>Offcourse you can also do this at your serverconfiguration, but because most of you people don&#8217;t have access to the server config your website runs on, htaccess is the best way.</p>
<p>To accomplish this, add the following code to your htaccess-file</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
</pre>
<pre>RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.dotred.be/bart/2011/04/30/to-www-or-not-to-www/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

