<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:gd="http://schemas.google.com/g/2005" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CkIBQno7fCp7ImA9Wx5TFEw.&quot;"><id>tag:blogger.com,1999:blog-380980011076825656</id><updated>2010-07-29T15:35:53.404+02:00</updated><title>$cat /dev/stream</title><subtitle type="html">Random bits and bytes of a software engineer's daily development stream.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://devstream.stefanklumpp.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://devstream.stefanklumpp.com/" /><author><name>Stefan Klumpp</name><uri>http://www.blogger.com/profile/02899343387413244345</uri><email>noreply@blogger.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/devstream" /><feedburner:info uri="devstream" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;AkEDRng4fip7ImA9WxBaFUg.&quot;"><id>tag:blogger.com,1999:blog-380980011076825656.post-2261908605575802447</id><published>2010-03-25T23:54:00.001+01:00</published><updated>2010-03-26T00:11:17.636+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-26T00:11:17.636+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="bookmarks" /><category scheme="http://www.blogger.com/atom/ns#" term="shortcuts" /><category scheme="http://www.blogger.com/atom/ns#" term="Google Chrome" /><title>Chrome: adding shortcuts to bookmarks</title><content type="html">In Firefox you can associate shortcuts to your bookmarks, which I used to:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;quickly open &lt;b&gt;frequently used sites&lt;/b&gt;, e.g. Gmail, Facebook, etc. or&lt;/li&gt;
&lt;li&gt;to open a page with a &lt;b&gt;specific topic&lt;/b&gt;, e.g. the Wikipedia article about "Linux" or&lt;/li&gt;
&lt;li&gt;to trigger a &lt;b&gt;custom search or query&lt;/b&gt;, e.g. on Google Translate&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;Now that I recently switched from Firefox to Chrome I imported my Firefox bookmarks and still had the shortcuts available, but when I edited my bookmarks I couldn't find the option to modify the shortcuts, neither could I add new shortcuts.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;After playing around a while I finally found something called &lt;b&gt;"Search Engines"&lt;/b&gt;, which is a bit of a misleading name, but does exactly the same as bookmark shortcuts in Firefox.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;You get there by right clicking on the &lt;b&gt;URL bar / search bar&lt;/b&gt; and selecting &lt;b&gt;Edit Search Engines...&lt;/b&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_K6NH2gxxhAc/S6voMM-w5KI/AAAAAAAAGOQ/ZtN16AP6phQ/s1600/01_chrome_shortcuts.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_K6NH2gxxhAc/S6voMM-w5KI/AAAAAAAAGOQ/ZtN16AP6phQ/s320/01_chrome_shortcuts.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Now, when you click on &lt;b&gt;Add&lt;/b&gt;&amp;nbsp;you get a form like this, where &lt;b&gt;Keyword&lt;/b&gt;&amp;nbsp;is the shortcut you use in the address bar, &lt;b&gt;URL&lt;/b&gt;&amp;nbsp;the site where you wanna go with &lt;b&gt;%s&lt;/b&gt;&amp;nbsp;as a placeholder for your search term.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_K6NH2gxxhAc/S6vogpyYGxI/AAAAAAAAGOY/6M3ix3UIdkk/s1600/03_chrome_shortcuts.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_K6NH2gxxhAc/S6vogpyYGxI/AAAAAAAAGOY/6M3ix3UIdkk/s320/03_chrome_shortcuts.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div&gt;In this case to get to the Wikipedia article for "Linux" I would just have to enter &lt;b&gt;"wiki Linux"&lt;/b&gt;&amp;nbsp;in the address bar and I get directly there.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;In case you wanna go to a static URL like &lt;a href="https://mail.google.com/"&gt;Gmail&lt;/a&gt; you just don't use the &lt;b&gt;%s&lt;/b&gt;&amp;nbsp;placeholder and enter the URL completely.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/380980011076825656-2261908605575802447?l=devstream.stefanklumpp.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devstream/~4/FeBwqhX0YWw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://devstream.stefanklumpp.com/feeds/2261908605575802447/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=380980011076825656&amp;postID=2261908605575802447&amp;isPopup=true" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/2261908605575802447?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/2261908605575802447?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devstream/~3/FeBwqhX0YWw/chrome-adding-shortcuts-to-bookmarks.html" title="Chrome: adding shortcuts to bookmarks" /><author><name>Stefan Klumpp</name><uri>http://www.blogger.com/profile/02899343387413244345</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="16104961862502439725" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_K6NH2gxxhAc/S6voMM-w5KI/AAAAAAAAGOQ/ZtN16AP6phQ/s72-c/01_chrome_shortcuts.png" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://devstream.stefanklumpp.com/2010/03/chrome-adding-shortcuts-to-bookmarks.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYNQH4-fCp7ImA9WxBUGUU.&quot;"><id>tag:blogger.com,1999:blog-380980011076825656.post-9146407912970552648</id><published>2010-03-07T17:57:00.002+01:00</published><updated>2010-03-07T18:16:31.054+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-07T18:16:31.054+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse" /><category scheme="http://www.blogger.com/atom/ns#" term="Android" /><title>Andoid: Eclipse error  "Conversion to Dalvik format failed"</title><content type="html">If you receive this error in Eclipse when compiling large .java files or using big .jar libraries&lt;br /&gt;
&lt;blockquote&gt;&lt;pre&gt;[2009-03-30 17:28:14 - Dex Loader] Unable to execute dex: null
[2009-03-30 17:28:14 - MyProject] Conversion to Dalvik format failed: 
Unable to execute dex: null&amp;nbsp;&lt;/pre&gt;&lt;/blockquote&gt;then add the following to your &lt;i&gt;eclipse.ini&lt;/i&gt; and the problem should be fixed:&lt;br /&gt;
&lt;blockquote&gt;&lt;pre&gt;-Xms128m
-Xmx512m&lt;/pre&gt;&lt;/blockquote&gt;Still problems? Increase these values and try again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/380980011076825656-9146407912970552648?l=devstream.stefanklumpp.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devstream/~4/Lj22ygZ5hi0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://devstream.stefanklumpp.com/feeds/9146407912970552648/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=380980011076825656&amp;postID=9146407912970552648&amp;isPopup=true" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/9146407912970552648?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/9146407912970552648?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devstream/~3/Lj22ygZ5hi0/andoid-eclipse-error-conversion-to.html" title="Andoid: Eclipse error  &quot;Conversion to Dalvik format failed&quot;" /><author><name>Stefan Klumpp</name><uri>http://www.blogger.com/profile/02899343387413244345</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="16104961862502439725" /></author><thr:total>4</thr:total><feedburner:origLink>http://devstream.stefanklumpp.com/2010/03/andoid-eclipse-error-conversion-to.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MGQ3w-eSp7ImA9WxFSEEs.&quot;"><id>tag:blogger.com,1999:blog-380980011076825656.post-6381226380166065465</id><published>2010-03-07T15:40:00.005+01:00</published><updated>2010-04-12T11:43:42.251+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-12T11:43:42.251+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="iPhone" /><category scheme="http://www.blogger.com/atom/ns#" term="debug" /><title>iPhone: debugging EXC_BAD_ACCESS errors</title><content type="html">After developing for iPhone and Android for quite some time now I consider myself an advanced developer on both these mobile platforms. But even though I left the beginner stage, sometimes things still don't work as they should (or at least as I expected) and I thought sharing some of my learning experiences would help other developers to lessen their pain.&lt;br /&gt;
&lt;br /&gt;
One of the biggest pains (besides Objective-C itself) is definitely the memory management on the iPhone. Luckily we don't have this problems on Android, due to the fact of using Java and garbage collection, which makes programming an ease (almost!) and enables you to focus on creating something rather than wasting a lot of time debugging. However, Apple decided not to include garbage collection for the iPhone, even though it's available within their frameworks and is actually used for Mac development. I won't elaborate much more on the pros and cons of &lt;a href="http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmPractical.html"&gt;Objective-C's memory management&lt;/a&gt; and the object ownership concept, since a lot of other bloggers ranted about that topic already too many times before me, but rather give you some useful tips to reduce the time you spend debugging.&lt;br /&gt;
&lt;br /&gt;
The most common problem you will have is probably an&lt;i&gt; EXC_BAD_ACCESS&lt;/i&gt; error, which occurs when you try to release memory that has already been released. This could be the reason if for example you try&lt;br /&gt;
&lt;ul&gt;&lt;li&gt; to release an object, which you don't own&lt;/li&gt;
&lt;li&gt;to release an object, which is in the autorelease pool&lt;/li&gt;
&lt;li&gt;to release an object, which has the "assign" property instead of "retain"&lt;/li&gt;
&lt;/ul&gt;&lt;a name='more'&gt;&lt;/a&gt;The problem with that is, that the error doesn't occur at the point where you accidentally release the object, but when the object gets released somewhere else at a later point in the code, where it is actually supposed to be released. This could be either by another owner or when the autorelease pool is getting cleaned-up. And this &lt;i&gt;"somewhere else"&lt;/i&gt; might not be easy to find. In general I recommend to compile and test your code as often as possible, because of the complex way you have to declare variables and allocate memory in Objective-C (declare, @property, @synthesize, eventually retain and release) it's very likely that you forget one of the steps in your code, especially when things need to be done quickly. In the end you will spend more time debugging and finding the problem than what it would have taken with just being more thorough from the beginning on.&lt;br /&gt;
&lt;br /&gt;
You might, for example, get an output like this:&lt;br /&gt;
&lt;blockquote&gt;2010-03-07 15:03:11.136 MyProject[&lt;span style="color: red;"&gt;58016&lt;/span&gt;:207] *** -[UIView setFrame:]: message sent to deallocated instance &lt;span style="color: red;"&gt;0x1b33240&lt;/span&gt;&lt;br /&gt;
Program received signal:&amp;nbsp; “EXC_BAD_ACCESS”. &lt;/blockquote&gt;Finding the source of that problem is hard by just knowing the object's address in memory: &lt;i&gt;0x1b33240&lt;/i&gt;. Thus we should enable a few options in our executable's settings: under &lt;i&gt;group &amp;amp; files&lt;/i&gt; doubleclick on your executable and then under the "&lt;i&gt;Arguments&lt;/i&gt;" tab add and enable the following options: &lt;br /&gt;
&lt;blockquote&gt;NSDebugEnabled&lt;br /&gt;
MallocStackLogging&lt;br /&gt;
NSZombieEnabled&lt;br /&gt;
MallocStackLoggingNoCompact &lt;/blockquote&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_K6NH2gxxhAc/S5O1e3V9t3I/AAAAAAAAGJ8/FW7niU_QC8s/s1600-h/01+executable+properties.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://2.bp.blogspot.com/_K6NH2gxxhAc/S5O1e3V9t3I/AAAAAAAAGJ8/FW7niU_QC8s/s400/01+executable+properties.png" width="337" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Now recompile your code, run it in the simulator and try to reproduce the same error you had before. But this time you will be able to enter the following command in &lt;i&gt;gdb&lt;/i&gt;:&lt;br /&gt;
&lt;blockquote&gt;&lt;i&gt;shell malloc_history $PID $ADDRESS_OF_OBJECT_IN_MEMORY&lt;pid&gt; &lt;object's address="" in="" memory=""&gt;&lt;/object's&gt;&lt;/pid&gt;&lt;/i&gt;&lt;/blockquote&gt;In our case that would be (see the pid and address I marked red above):&lt;br /&gt;
&lt;blockquote&gt;&lt;i&gt;shell malloc_history &lt;span style="color: red;"&gt;58016&lt;/span&gt; &lt;span style="color: red;"&gt;0x1b33240&lt;/span&gt;&lt;/i&gt;&lt;/blockquote&gt;and results with the following (or similar) output: &lt;br /&gt;
&lt;blockquote&gt;ALLOC 0x1b33240-0x1b33267 [size=40]: thread_a02fa500 |start | main | UIApplicationMain | -[UIApplication _run] | CFRunLoopRunInMode | CFRunLoopRunSpecific | PurpleEventCallback | _UIApplicationHandleEvent | -[UIApplication sendEvent:] | -[UIApplication handleEvent:withNewEvent:] | -[UIApplication _reportAppLaunchFinished] | CA::Transaction::commit() | CA::Context::commit_transaction(CA::Transaction*) | CALayerLayoutIfNeeded | -[CALayer layoutSublayers] | -[UILayoutContainerView layoutSubviews] | -[UINavigationController _startDeferredTransitionIfNeeded] | -[UINavigationController _startTransition:fromViewController:toViewController:] | -[UINavigationController _layoutViewController:] | -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] | -[UIViewController contentScrollView] | -[UIViewController view] |&lt;b&gt;&lt;span style="color: red;"&gt; -[CategorySuperViewController loadView] | -[CategoryViewController initWithStyle:] | -[Functionality requestNewAd] | +[AdMobView requestAdWithDelegate:]&lt;/span&gt;&lt;/b&gt; | +[NSObject alloc] | +[NSObject allocWithZone:] | _internal_class_createInstance | _internal_class_createInstanceFromZone | calloc | malloc_zone_calloc &lt;/blockquote&gt;What we can see is where exactly the error occurs, but we still don't know by what it is caused and where this happens in the code. What we know though, is that it has something to do with an AdMobView object, which we most likely &lt;i&gt;released&lt;/i&gt; at some other point in our code where we shouldn't have released it (because we didn't have ownership or because it's on autorelease).&lt;br /&gt;
&lt;br /&gt;
To fix the problem we just check all AdMobView releases. If you're unsure you can just temporarily disable them, recompile and run it again to see if that was the problem. Another thing, that happens to me sometimes, is that I accidentally type &lt;i&gt;dealloc&lt;/i&gt; instead of &lt;i&gt;release&lt;/i&gt;, which immediately removes the object from memory, while with a &lt;i&gt;release&lt;/i&gt; it might keep existing, because it may still be owned by someone else. In general, never use &lt;i&gt;dealloc&lt;/i&gt; (unless you really know what you're doing).&lt;br /&gt;
&lt;br /&gt;
I hope this helps you to make iPhone development and debugging a bit easier and please let me know if something is still unclear.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/380980011076825656-6381226380166065465?l=devstream.stefanklumpp.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devstream/~4/grBIh5g7u2c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://devstream.stefanklumpp.com/feeds/6381226380166065465/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=380980011076825656&amp;postID=6381226380166065465&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/6381226380166065465?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/6381226380166065465?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devstream/~3/grBIh5g7u2c/iphone-debugging-excbadaccess-errors.html" title="iPhone: debugging EXC_BAD_ACCESS errors" /><author><name>Stefan Klumpp</name><uri>http://www.blogger.com/profile/02899343387413244345</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="16104961862502439725" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_K6NH2gxxhAc/S5O1e3V9t3I/AAAAAAAAGJ8/FW7niU_QC8s/s72-c/01+executable+properties.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://devstream.stefanklumpp.com/2010/03/iphone-debugging-excbadaccess-errors.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0AFQHs8cCp7ImA9WxBUGUs.&quot;"><id>tag:blogger.com,1999:blog-380980011076825656.post-8267065886849679501</id><published>2010-03-07T13:41:00.000+01:00</published><updated>2010-03-07T13:41:51.578+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-07T13:41:51.578+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Android" /><category scheme="http://www.blogger.com/atom/ns#" term="Swype" /><title>Swype beta for Android</title><content type="html">After having been using the leaked version of &lt;a href="http://swypeinc.com/"&gt;Swype&lt;/a&gt; for a while, I'm happy to hear that they finally provide an &lt;a href="http://beta.swype.com/"&gt;official beta for Android&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
If you haven't heard about Swype, yet, it's an innovate new way of rapidly entering text on&amp;nbsp;mobile touch screen devices.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_K6NH2gxxhAc/S5OaQs0J7SI/AAAAAAAAGJ0/-KxA7OQJsUs/s1600-h/swypetextentry.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="252" src="http://1.bp.blogspot.com/_K6NH2gxxhAc/S5OaQs0J7SI/AAAAAAAAGJ0/-KxA7OQJsUs/s320/swypetextentry.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I highly recommend that you give it a try. I cannot image going back to the standard Android or iPhone keyboard, even though they're pretty good themselves. Check out this video comparing Swype with a standard touch keyboard.&lt;/div&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object height="385" width="480"&gt;&lt;param name="movie" value="http://www.youtube.com/v/pTooBnKAdSw&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;color1=0x234900&amp;color2=0x4e9e00"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/pTooBnKAdSw&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;color1=0x234900&amp;color2=0x4e9e00" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;
Finally convinced? Get it &lt;a href="http://beta.swype.com/"&gt;here&lt;/a&gt; on Swype's beta page. Unfortunatelly, they made it a bit of a hassle to install. First you have to sign-up for their limited beta program, then you have to download the Swype Installer, install it, run it and log in. Now it will actually download the "real" Swype keyboard application. Need more details and help? Swype provides a &lt;a href="https://beta.swype.com//android/welcome/detailed/"&gt;step-by-step guide&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Some users, including myself, who had the leaked version of Swype installed before, might have some problems when switching over to the official beta. I got the following message:&lt;br /&gt;
&lt;blockquote&gt;"The Swype package you installed is configured for another device and  will operate with limited functionality. Please contact Swype about this  issue."&lt;/blockquote&gt;and wasn't actually able to swype. Pressing the letters one by one (like on a normal keyboard) worked, though. As a &lt;a href="http://forum.xda-developers.com/showthread.php?p=5810990#post5810990"&gt;user pointed out on xda-developers.com&lt;/a&gt;&amp;nbsp;you have to do the following steps to make it finally work:&lt;br /&gt;
&lt;blockquote&gt;1) Long hold your text box.&lt;br /&gt;
2) Switch input methods to another keyboard.&lt;br /&gt;
3) Type a letter or two. Swap back to Swype.&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/380980011076825656-8267065886849679501?l=devstream.stefanklumpp.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devstream/~4/07QDo3xjKsA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://devstream.stefanklumpp.com/feeds/8267065886849679501/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=380980011076825656&amp;postID=8267065886849679501&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/8267065886849679501?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/8267065886849679501?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devstream/~3/07QDo3xjKsA/swype-beta-for-android.html" title="Swype beta for Android" /><author><name>Stefan Klumpp</name><uri>http://www.blogger.com/profile/02899343387413244345</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="16104961862502439725" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_K6NH2gxxhAc/S5OaQs0J7SI/AAAAAAAAGJ0/-KxA7OQJsUs/s72-c/swypetextentry.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://devstream.stefanklumpp.com/2010/03/swype-beta-for-android.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYMR3Y4cCp7ImA9WxBVGUs.&quot;"><id>tag:blogger.com,1999:blog-380980011076825656.post-3828742682621239038</id><published>2010-02-21T23:59:00.001+01:00</published><updated>2010-02-24T00:03:06.838+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-24T00:03:06.838+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Outdoors" /><category scheme="http://www.blogger.com/atom/ns#" term="Android" /><title>My Tracks for Google Android</title><content type="html">Have been playing around with &lt;a href="http://mytracks.appspot.com/" target="_blank"&gt;My Tracks&lt;/a&gt; for Google Android this weekend. It's an application that tracks your location on a map (e.g. during a bike tour or a day of skiing down the slopes or whatever else you can think of) and monitors real time statistics like time, distance, speed and elevation. I didn't log the whole thing, because I was already on low battery when I left the house, but this should give you a pretty good idea of how it works. Here are the two links to view the route: [ &lt;a href="http://maps.google.com/maps/ms?ie=UTF8&amp;amp;hl=en&amp;amp;msa=0&amp;amp;msid=111461731570738601636.0004800c9f2c5d1087c6d&amp;amp;t=k&amp;amp;z=13" target="_blank"&gt;Google Maps&lt;/a&gt; | &lt;a href="http://stefanklumpp.com/mytracks/2010_02_21_BarcelonaCityTour.kml" target="_blank"&gt;Google Earth&lt;/a&gt; ]. FYI, I had my Nexus One almost the whole time in my pocket. For that I'm pretty surprised with the resulting accuracy of my track.&lt;br /&gt;
&lt;br /&gt;
My Tracks doesn't support adding pictures, yet, but you can easily do that with Google's &lt;a href="http://www.android.com/market/free.html#app=mymapseditor" target="_blank"&gt;My Maps Editor for Android&lt;/a&gt;. And other than playing around with new mobile technology all day long I was also able to enjoy another beautiful "winter" day in Barcelona (see pictures &lt;a href="http://blog.stefanklumpp.com/2010/02/21/barcelona-city-tour"&gt;here&lt;/a&gt;).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/380980011076825656-3828742682621239038?l=devstream.stefanklumpp.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devstream/~4/6wdeeIKxoA4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://devstream.stefanklumpp.com/feeds/3828742682621239038/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=380980011076825656&amp;postID=3828742682621239038&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/3828742682621239038?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/3828742682621239038?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devstream/~3/6wdeeIKxoA4/my-tracks-for-google-android.html" title="My Tracks for Google Android" /><author><name>Stefan Klumpp</name><uri>http://www.blogger.com/profile/02899343387413244345</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="16104961862502439725" /></author><thr:total>0</thr:total><feedburner:origLink>http://devstream.stefanklumpp.com/2010/02/my-tracks-for-google-android.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcNQX46eip7ImA9WxBXEko.&quot;"><id>tag:blogger.com,1999:blog-380980011076825656.post-1668877719234642836</id><published>2010-01-23T20:46:00.001+01:00</published><updated>2010-01-23T20:48:10.012+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-23T20:48:10.012+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="layout" /><category scheme="http://www.blogger.com/atom/ns#" term="Android" /><category scheme="http://www.blogger.com/atom/ns#" term="resource" /><title>Android: providing different layout resources for older versions</title><content type="html">To provide backward compatibility with older phones still running on &lt;i&gt;Android 1.5&lt;/i&gt; you might have to provide separate layout resources for &lt;i&gt;Android 1.5&lt;/i&gt; and &lt;i&gt;Android 1.6+&lt;/i&gt;. Especially when dealing a lot with &lt;i&gt;RelativeLayout&lt;/i&gt;, which was basically crap before &lt;i&gt;Android 1.6&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
Instead of having one &lt;i&gt;res/layout&lt;/i&gt; folder we will create two new folders:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;i&gt;res/layout-v3&lt;/i&gt; for Android 1.5&lt;/li&gt;
&lt;li&gt;&lt;i&gt;res/layout-v4&lt;/i&gt; for Android 1.6 and higher&lt;/li&gt;
&lt;/ul&gt;Now move all your files to &lt;i&gt;res/layout-v3&lt;/i&gt; and test your application on various phones and emulators (which are running different Android versions). Whenever you see that there's a non-acceptable difference in the layout copy the responsible &lt;i&gt;.xml&lt;/i&gt;-file to the &lt;i&gt;res/layout-v4&lt;/i&gt; folder and modify the file in both folders so that they work for &lt;i&gt;Android 1.5&lt;/i&gt; and &lt;i&gt;Android 1.6 and higher&lt;/i&gt; again. Android will then pick the right layout resource during runtime depending on its current firmware version.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Bug in Android 2.0&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
There seems to be a bug in Android 2.0. Instead of picking the resource from &lt;i&gt;res/layout-v4&lt;/i&gt; as it should and if it doesn't find it there then from &lt;i&gt;res/layout-v3&lt;/i&gt;, it expects the the resource wrongly in the default &lt;i&gt;res/layout&lt;/i&gt; folder. To make it work you should rename &lt;i&gt;res/layout-v3&lt;/i&gt; back to &lt;i&gt;res/layout&lt;/i&gt; again (or just create a symlink). The second problem or bug that comes with it, is to provide the special resources for Android 2.0 or higher. Instead of providing those in &lt;i&gt;res/layout-v5&lt;/i&gt; Android 2.0 expects wrongly &lt;i&gt;res/layout-v6&lt;/i&gt;. So just use this instead for now. The bug is fixed in Android 2.0.1, but there are still quite some Android 2.0 phones out there.&lt;br /&gt;
&lt;br /&gt;
I hope this post is not too confusing ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/380980011076825656-1668877719234642836?l=devstream.stefanklumpp.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devstream/~4/qdkuWBQuh7c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://devstream.stefanklumpp.com/feeds/1668877719234642836/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=380980011076825656&amp;postID=1668877719234642836&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/1668877719234642836?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/1668877719234642836?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devstream/~3/qdkuWBQuh7c/android-providing-different-layout.html" title="Android: providing different layout resources for older versions" /><author><name>Stefan Klumpp</name><uri>http://www.blogger.com/profile/02899343387413244345</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="16104961862502439725" /></author><thr:total>0</thr:total><feedburner:origLink>http://devstream.stefanklumpp.com/2010/01/android-providing-different-layout.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEQGQnk6fyp7ImA9WxBXEko.&quot;"><id>tag:blogger.com,1999:blog-380980011076825656.post-286516756751546209</id><published>2009-11-21T20:05:00.003+01:00</published><updated>2010-01-23T20:52:03.717+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-23T20:52:03.717+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial" /><category scheme="http://www.blogger.com/atom/ns#" term="ListView" /><category scheme="http://www.blogger.com/atom/ns#" term="Android" /><title>Android: Custom List Item with nested clickable Button</title><content type="html">This tutorial will show you how to add a button (or any other clickable item) to a customized list view item.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_K6NH2gxxhAc/Swg0hqNDlTI/AAAAAAAAEQU/4qG-YjJRuBM/s1600/Android_ButtonOnListView.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_K6NH2gxxhAc/Swg0hqNDlTI/AAAAAAAAEQU/4qG-YjJRuBM/s320/Android_ButtonOnListView.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
In the screenshot above you can see a &lt;a href="http://developer.android.com/reference/android/widget/ListView.html"&gt;ListView&lt;/a&gt; with custom built items. Each list item consists of&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;TextView for the title&lt;/li&gt;
&lt;li&gt;TextView for the content&lt;/li&gt;
&lt;li&gt;RelativeLayout (&lt;b&gt;clickable&lt;/b&gt;) consisting of&lt;/li&gt;

&lt;ul&gt;&lt;li&gt;TextView: "For more information click here"&lt;/li&gt;
&lt;li&gt;ImageView for the arrow icon&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;We start this tutorial at a point where you should already know how to create your own customized ListViews and Adapters. If you have no clue how to do so please let me know in the comments. If there's a demand I will eventually compile another tutorial about creating custom list items and list adapters in the future.&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;1) Build custom adapter that extends &lt;a href="http://developer.android.com/reference/android/widget/BaseAdapter.html"&gt;BaseAdapter&lt;/a&gt; and implement all the required inherited abstract methods from the parent class:&lt;/b&gt;&lt;br /&gt;
&lt;script class="brush: js; wrap-lines: false" type="syntaxhighlighter"&gt;
&lt;![CDATA[
public class MyAdapter extends BaseAdapter {
]]&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;b&gt;2) Implement &lt;a href="http://developer.android.com/reference/android/widget/Adapter.html#getView%28int,%20android.view.View,%20android.view.ViewGroup%29"&gt;View getView(int position, View convertView, ViewGroup parent)&lt;/a&gt;:&lt;/b&gt;&lt;br /&gt;
This is where you create and manipulate the view that is used for a list item. I highly recommend that you take advantage of a view holder as it is described in this &lt;a href="http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/List14.html"&gt;API example&lt;/a&gt; to improve speed and efficiency.&lt;br /&gt;
&lt;br /&gt;
The crucial part is now that you, after you have inflated the list item's main layout &lt;br /&gt;
&lt;script class="brush: js; wrap-lines: false" type="syntaxhighlighter"&gt;
&lt;![CDATA[
convertView = mInflater.inflate(R.layout.list_item, null);
]]&gt;
&lt;/script&gt;&lt;br /&gt;
you also need to get hold of the sub-layout (bottom part). That's the part you want to be clickable. &lt;br /&gt;
&lt;script class="brush: js; wrap-lines: false" type="syntaxhighlighter"&gt;
&lt;![CDATA[
holder.layout_bottom = (RelativeLayout) convertView.findViewById(R.id.layout_listitem_bottom);
]]&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;b&gt;3) Create an onClickListener for the bottom layout and associate the data (in this case a web URL) with the current view:&lt;/b&gt;&lt;br /&gt;
&lt;script class="brush: js; wrap-lines: false" type="syntaxhighlighter"&gt;
&lt;![CDATA[
holder.layout_bottom.setFocusable(true);
holder.layout_bottom.setClickable(true);
holder.layout_bottom.setTag(curItem.url);
holder.layout_bottom.setOnClickListener(new OnClickListener() {
 @Override
 public void onClick(View view) {
  String url = (String) view.getTag();
  Intent myIntent = new Intent(view.getContext(), WebView_Activity.class);
  myIntent.putExtra("url", url);
  view.getContext().startActivity(myIntent);
 }
});
]]&gt;
&lt;/script&gt;&lt;br /&gt;
While for a &lt;a href="http://developer.android.com/reference/android/widget/AdapterView.OnItemClickListener.html"&gt;OnItemClickListener&lt;/a&gt;, which is associated to each item of a ListView, we always know which item of the list has been selected through the int position paremeter. We don't have this information for our &lt;a href="http://developer.android.com/reference/android/view/View.OnClickListener.html"&gt;OnClickListener&lt;/a&gt; that is used in the bottom layout. So how do we get the neccessary information that is associated to the current list item?&lt;br /&gt;
&lt;br /&gt;
The trick is to use &lt;a href="http://developer.android.com/reference/android/view/View.html#setTag%28java.lang.Object%29"&gt;View.setTag()&lt;/a&gt; and &lt;a href="http://developer.android.com/reference/android/view/View.html#getTag%28%29"&gt;View.getTag()&lt;/a&gt;. The Android documentation states: &lt;i&gt;“Sets the tag associated with this view. A tag can be used to mark a view in its hierarchy and does not have to be unique within the hierarchy. Tags can also be used to &lt;u&gt;store data within a view&lt;/u&gt; without resorting to another data structure.”&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
In this example we use setTag() to store an URL with each sub-layout and getTag() in the onClickListener to extract that URL whenever a sub-layout was clicked. Then we create an Intent for our WebView, pass the URL to it and start a new Activity. And Voilà! You should have a web browser now displaying the website associated to the item you clicked before. &lt;br /&gt;
&lt;br /&gt;
However, there's one little detail that keeps annoying me. Even though I now can click/tap the bar at the bottom via the touch screen interface I'm not able to select it via the trackball. It always selects the whole list item (see screenshot below) and from there goes directly to the next list item ignoring the bottom bar, even though I set &lt;code&gt;.setFocusable(true)&lt;/code&gt; and &lt;code&gt;setClickable(true)&lt;/code&gt; for the bottom bar's RelativeLayout in &lt;code&gt;getView()&lt;/code&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_K6NH2gxxhAc/Swg5DSrwZOI/AAAAAAAAEQc/a0EZzO86weU/s1600/Android_ButtonOnListView_Selector.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_K6NH2gxxhAc/Swg5DSrwZOI/AAAAAAAAEQc/a0EZzO86weU/s320/Android_ButtonOnListView_Selector.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
If anyone knows a solution to this please let me know in the comments or respond to &lt;a href="http://stackoverflow.com/questions/1709166/android-listview-elements-with-multiple-clickable-buttons"&gt;my question&lt;/a&gt; asked on stackoverflow.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/380980011076825656-286516756751546209?l=devstream.stefanklumpp.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devstream/~4/jPGiGp4pLZM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://devstream.stefanklumpp.com/feeds/286516756751546209/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=380980011076825656&amp;postID=286516756751546209&amp;isPopup=true" title="12 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/286516756751546209?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/286516756751546209?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devstream/~3/jPGiGp4pLZM/android-custom-list-item-with-nested.html" title="Android: Custom List Item with nested clickable Button" /><author><name>Stefan Klumpp</name><uri>http://www.blogger.com/profile/02899343387413244345</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="16104961862502439725" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_K6NH2gxxhAc/Swg0hqNDlTI/AAAAAAAAEQU/4qG-YjJRuBM/s72-c/Android_ButtonOnListView.png" height="72" width="72" /><thr:total>12</thr:total><feedburner:origLink>http://devstream.stefanklumpp.com/2009/11/android-custom-list-item-with-nested.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEQCSX0yfyp7ImA9WxBXEko.&quot;"><id>tag:blogger.com,1999:blog-380980011076825656.post-6441728542276885039</id><published>2009-11-07T16:02:00.009+01:00</published><updated>2010-01-23T20:52:48.397+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-23T20:52:48.397+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial" /><category scheme="http://www.blogger.com/atom/ns#" term="JSON" /><category scheme="http://www.blogger.com/atom/ns#" term="HTTP" /><category scheme="http://www.blogger.com/atom/ns#" term="Android" /><title>Android: Simple HttpClient to send/receive JSON Objects</title><content type="html">This tutorial is focused on creating a very simple HTTP client for Google's mobile operating system &lt;a href="http://en.wikipedia.org/wiki/Android_%28operating_system%29"&gt;Android&lt;/a&gt;, which then can communicate with a web server and exchange &lt;a href="http://en.wikipedia.org/wiki/JSON"&gt;JSON&lt;/a&gt; information. I won't go too much into detail, since the code is pretty much self-explaining and already has a lot of comments describing the program flow.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_K6NH2gxxhAc/SvWUpjsWIcI/AAAAAAAAEL8/cPPLLmBGgFY/s1600-h/SimpleHttpClient_JSON.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_K6NH2gxxhAc/SvWUpjsWIcI/AAAAAAAAEL8/cPPLLmBGgFY/s320/SimpleHttpClient_JSON.png" /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;1) Create a new Android project&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2) Add permission to access the Internet from your application to your &lt;i&gt;AndroidManifest.xml&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush: xml;"&gt;&lt;manifest&gt;
    
    &lt;uses-permission android:name="android.permission.INTERNET"&gt;
&lt;/uses-permission&gt;
&lt;/manifest&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;3)&amp;nbsp;Create a new (static) class called &lt;i&gt;HttpClient.java&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;script class="brush: js; wrap-lines: false" type="syntaxhighlighter"&gt;
&lt;![CDATA[
/***
 Copyright (c) 2009 
 Author: Stefan Klumpp &lt;stefan.klumpp@gmail.com&gt;
 Web: http://stefanklumpp.com

 Licensed under the Apache License, Version 2.0 (the "License"); you may
 not use this file except in compliance with the License. You may obtain
 a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */

package com.devstream.http;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.zip.GZIPInputStream;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONObject;
import android.util.Log;

public class HttpClient {
 private static final String TAG = "HttpClient";

 public static JSONObject SendHttpPost(String URL, JSONObject jsonObjSend) {

  try {
   DefaultHttpClient httpclient = new DefaultHttpClient();
   HttpPost httpPostRequest = new HttpPost(URL);

   StringEntity se;
   se = new StringEntity(jsonObjSend.toString());

   // Set HTTP parameters
   httpPostRequest.setEntity(se);
   httpPostRequest.setHeader("Accept", "application/json");
   httpPostRequest.setHeader("Content-type", "application/json");
   httpPostRequest.setHeader("Accept-Encoding", "gzip"); // only set this parameter if you would like to use gzip compression

   long t = System.currentTimeMillis();
   HttpResponse response = (HttpResponse) httpclient.execute(httpPostRequest);
   Log.i(TAG, "HTTPResponse received in [" + (System.currentTimeMillis()-t) + "ms]");

   // Get hold of the response entity (-&gt; the data):
   HttpEntity entity = response.getEntity();

   if (entity != null) {
    // Read the content stream
    InputStream instream = entity.getContent();
    Header contentEncoding = response.getFirstHeader("Content-Encoding");
    if (contentEncoding != null &amp;amp;&amp;amp; contentEncoding.getValue().equalsIgnoreCase("gzip")) {
     instream = new GZIPInputStream(instream);
    }

    // convert content stream to a String
    String resultString= convertStreamToString(instream);
    instream.close();
    resultString = resultString.substring(1,resultString.length()-1); // remove wrapping "[" and "]"

    // Transform the String into a JSONObject
    JSONObject jsonObjRecv = new JSONObject(resultString);
    // Raw DEBUG output of our received JSON object:
    Log.i(TAG,"&lt;jsonobject&gt;\n"+jsonObjRecv.toString()+"\n&lt;/jsonobject&gt;");

    return jsonObjRecv;
   } 

  }
  catch (Exception e)
  {
   // More about HTTP exception handling in another tutorial.
   // For now we just print the stack trace.
   e.printStackTrace();
  }
  return null;
 }


 private static String convertStreamToString(InputStream is) {
  /*
   * To convert the InputStream to String we use the BufferedReader.readLine()
   * method. We iterate until the BufferedReader return null which means
   * there's no more data to read. Each line will appended to a StringBuilder
   * and returned as String.
   * 
   * (c) public domain: http://senior.ceng.metu.edu.tr/2009/praeda/2009/01/11/a-simple-restful-client-at-android/
   */
  BufferedReader reader = new BufferedReader(new InputStreamReader(is));
  StringBuilder sb = new StringBuilder();

  String line = null;
  try {
   while ((line = reader.readLine()) != null) {
    sb.append(line + "\n");
   }
  } catch (IOException e) {
   e.printStackTrace();
  } finally {
   try {
    is.close();
   } catch (IOException e) {
    e.printStackTrace();
   }
  }
  return sb.toString();
 }

}
]]&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;4) Add the following code to your &lt;i&gt;MainActivity.java&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;script class="brush: js; wrap-lines: false" type="syntaxhighlighter"&gt;
&lt;![CDATA[
/***
 Copyright (c) 2009 
 Author: Stefan Klumpp &lt;stefan.klumpp@gmail.com&gt;
 Web: http://stefanklumpp.com
  
 Licensed under the Apache License, Version 2.0 (the "License"); you may
 not use this file except in compliance with the License. You may obtain
 a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
*/


package com.devstream.http;

import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

public class MainActivity extends Activity {
 private static final String TAG = "MainActivity";
 private static final String URL = "http://www.yourdomain.com:80";

 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);

  // JSON object to hold the information, which is sent to the server
  JSONObject jsonObjSend = new JSONObject();

  try {
   // Add key/value pairs
   jsonObjSend.put("key_1", "value_1");
   jsonObjSend.put("key_2", "value_2");

   // Add a nested JSONObject (e.g. for header information)
   JSONObject header = new JSONObject();
   header.put("deviceType","Android"); // Device type
   header.put("deviceVersion","2.0"); // Device OS version
   header.put("language", "es-es"); // Language of the Android client
   jsonObjSend.put("header", header);
   
   // Output the JSON object we're sending to Logcat:
   Log.i(TAG, jsonObjSend.toString(2));

  } catch (JSONException e) {
   e.printStackTrace();
  }

  // Send the HttpPostRequest and receive a JSONObject in return
  JSONObject jsonObjRecv = HttpClient.SendHttpPost(URL, jsonObjSend);

  /*
   *  From here on do whatever you want with your JSONObject, e.g.
   *  1) Get the value for a key: jsonObjRecv.get("key");
   *  2) Get a nested JSONObject: jsonObjRecv.getJSONObject("key")
   *  3) Get a nested JSONArray: jsonObjRecv.getJSONArray("key") 
   */


 }
}
]]&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
The full source code is also available on &lt;a href="http://github.com/StefanKlumpp/Simple-HTTP-Client"&gt;GitHub&lt;/a&gt; for download.&lt;br /&gt;
&lt;br /&gt;
Check the official Android documentation for more information about &lt;a href="http://developer.android.com/reference/org/json/JSONObject.html"&gt;JSONObjects&lt;/a&gt; and Apache's &lt;a href="http://developer.android.com/reference/org/apache/http/package-summary.html"&gt;HttpClient&lt;/a&gt; classes.&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial was helpful for you. If it was too simple for your needs stay tuned. Upcoming tutorials will deal with the following topics:&lt;br /&gt;
&lt;blockquote&gt;&lt;ul&gt;&lt;li&gt;Creating a separate HttpClient &lt;i&gt;thread&lt;/i&gt; to uncouple the hard work happening in the background from the user interface&lt;/li&gt;
&lt;li&gt;Dealing with HTTP exceptions: transport exceptions, protocol exceptions, timeouts.&lt;/li&gt;
&lt;li&gt;Setting up a &lt;i&gt;BackgroundService&lt;/i&gt; and a &lt;i&gt;ServiceInterface&lt;/i&gt;, which will be the new home for our HttpClient. This enables many activies to simply connect to the service and to access the resources provided instead of creating a new HttpClient object for each activity&lt;/li&gt;
&lt;li&gt;Instead of using a simple HttpClient (as shown in this tutorial), we will utilize &lt;i&gt;ClientConnectionManager&lt;/i&gt; to provide us with a connection pool to save resources and improve performance&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/380980011076825656-6441728542276885039?l=devstream.stefanklumpp.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devstream/~4/g9LE8TlOx-o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://devstream.stefanklumpp.com/feeds/6441728542276885039/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=380980011076825656&amp;postID=6441728542276885039&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/6441728542276885039?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/6441728542276885039?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devstream/~3/g9LE8TlOx-o/android-simple-httpclient-to.html" title="Android: Simple HttpClient to send/receive JSON Objects" /><author><name>Stefan Klumpp</name><uri>http://www.blogger.com/profile/02899343387413244345</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="16104961862502439725" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_K6NH2gxxhAc/SvWUpjsWIcI/AAAAAAAAEL8/cPPLLmBGgFY/s72-c/SimpleHttpClient_JSON.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://devstream.stefanklumpp.com/2009/11/android-simple-httpclient-to.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck8DQHk6fCp7ImA9WxBbE04.&quot;"><id>tag:blogger.com,1999:blog-380980011076825656.post-4810370223824453281</id><published>2009-10-31T17:25:00.010+01:00</published><updated>2010-03-11T19:07:51.714+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-11T19:07:51.714+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial" /><category scheme="http://www.blogger.com/atom/ns#" term="ListView" /><category scheme="http://www.blogger.com/atom/ns#" term="Android" /><category scheme="http://www.blogger.com/atom/ns#" term="UserInterface" /><title>Android: Custom ListView Selector</title><content type="html">The following tutorial will show you how to create a custom list selector as shown in the image below. I use an orange frame around the selected list item in this example, but you can virtually design anything you like.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_K6NH2gxxhAc/SuxhD670DyI/AAAAAAAAEI8/VPcSQka2hv0/s1600-h/screenshot_list.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_K6NH2gxxhAc/SuxhD670DyI/AAAAAAAAEI8/VPcSQka2hv0/s320/screenshot_list.png" /&gt;&lt;/a&gt;&lt;/div&gt;To make it easier we use the original files for the list selector and transition from the Android SDK as a draft and modify them instead of starting from scratch.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1) Copy files from the Android SDK:&lt;/b&gt;&lt;br /&gt;
Go to &lt;i&gt;android-sdk/platforms/android-1.6/data/res/drawable&lt;/i&gt; and copy the following .xml files to your project's &lt;i&gt;/res/drawable&lt;/i&gt; folder:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;list_selector_background.xml&lt;/li&gt;
&lt;li&gt;list_selector_background_transition.xml&lt;/li&gt;
&lt;/ul&gt;You also need the following &lt;a href="http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch"&gt;9-patch&lt;/a&gt; images from the same folder, because they're referenced by the above .xml-files. You have to copy them, because within the SDK they're not a &lt;i&gt;public resource&lt;/i&gt;, which means you can't just access them through the &lt;i&gt;android:&lt;/i&gt; namespace as you could do with other public resources.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;list_selector_background_focus.9.png&lt;/li&gt;
&lt;li&gt;list_selector_background_longpress.9.png&lt;/li&gt;
&lt;li&gt;list_selector_background_pressed.9.png&lt;/li&gt;
&lt;li&gt;list_selector_background_disabled.9.png&lt;/li&gt;
&lt;/ul&gt;&lt;b&gt;2) Edit the two xml files and add to all resource values, which are publicly accessible the &lt;i&gt;"android:namespace"&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In our case this is only the following item:&lt;br /&gt;
&lt;pre class="brush: xml;"&gt;&lt;item android:drawable="@android:color/transparent" android:state_window_focused="false"&gt;&lt;/item&gt;&lt;/pre&gt;All the other elements can point to the local namespace, because we copied the resources (images) into our local project's &lt;i&gt;/res/drawable/&lt;/i&gt; folder.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3) Modify whatever you like&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Instead of having the selected list item been overpainted by a transparent orange color (as it is default in Android), I prefered to have a full opaque (non-transparent) border around the selected list item. Therefor I opened up the &lt;i&gt;list_selector_background_focus.9.png&lt;/i&gt; file in &lt;a href="http://www.gimp.org/"&gt;gimp&lt;/a&gt; and removed everything except of a thin orange frame (→ make sure the center is transparent). The black pixels around the image are &lt;a href="http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch"&gt;9-patch&lt;/a&gt; parameters. Don't remove them. If you want to modify them read up on it first &lt;a href="http://developer.android.com/guide/developing/tools/draw9patch.html"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_K6NH2gxxhAc/SuxlZHvSSsI/AAAAAAAAEJE/pkxmW1ecUYc/s1600-h/gimp_list_selector.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_K6NH2gxxhAc/SuxlZHvSSsI/AAAAAAAAEJE/pkxmW1ecUYc/s320/gimp_list_selector.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;4) Creating a new style&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Open up your &lt;i&gt;/res/values/styles.xml&lt;/i&gt; (create it if it doesn't exist) and add this new style to it:&lt;br /&gt;
&lt;pre class="brush: xml;"&gt;&lt;style name="MyListView" parent="@android:style/Widget.ListView"&gt;
 &lt;item name="android:listSelector"&gt;@drawable/list_selector_background&lt;/item&gt;
&lt;/style&gt;
&lt;/pre&gt;The &lt;i&gt;@drawable/list_selector_background&lt;/i&gt; is a reference to your list_selector_background.xml file in &lt;i&gt;/res/drawable/&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;5) Applying the new style to your layout&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Open up your layout's xml file and add the &lt;i&gt;style&lt;/i&gt; attribute&lt;listview&gt;&lt;b&gt;&lt;/b&gt;.&lt;/listview&gt;&lt;br /&gt;
&lt;pre class="brush: xml;"&gt;&lt;listview android:drawselectorontop="true" android:id="@+id/MyList" android:layout_height="wrap_content" android:layout_width="wrap_content"&gt;
&lt;/listview&gt;
&lt;/pre&gt;I also added &lt;i&gt;android:drawSelectorOnTop=“true”&lt;/i&gt; so that the orange image frame will be drawn with full opacity (no transparency effects).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/380980011076825656-4810370223824453281?l=devstream.stefanklumpp.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devstream/~4/JB-VbfhLHck" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://devstream.stefanklumpp.com/feeds/4810370223824453281/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=380980011076825656&amp;postID=4810370223824453281&amp;isPopup=true" title="7 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/4810370223824453281?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/4810370223824453281?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devstream/~3/JB-VbfhLHck/android-custom-listview-selector.html" title="Android: Custom ListView Selector" /><author><name>Stefan Klumpp</name><uri>http://www.blogger.com/profile/02899343387413244345</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="16104961862502439725" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_K6NH2gxxhAc/SuxhD670DyI/AAAAAAAAEI8/VPcSQka2hv0/s72-c/screenshot_list.png" height="72" width="72" /><thr:total>7</thr:total><feedburner:origLink>http://devstream.stefanklumpp.com/2009/10/android-custom-listview-selector.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEIESXsycCp7ImA9WxBXEko.&quot;"><id>tag:blogger.com,1999:blog-380980011076825656.post-7577711239359640357</id><published>2009-10-31T14:30:00.016+01:00</published><updated>2010-01-23T20:55:08.598+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-23T20:55:08.598+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="mock" /><category scheme="http://www.blogger.com/atom/ns#" term="GPS" /><category scheme="http://www.blogger.com/atom/ns#" term="Android" /><title>How to enable fake GPS on Android</title><content type="html">In order to build a location depend app or to test the behavior of your app at places besides the one you're currently located it is very helpful to use the Android emulator and just set your location manually.&lt;br /&gt;
&lt;br /&gt;
This post&amp;nbsp; will guide you through the steps of setting up fake GPS on the Google Android emulator&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Set permissions in AndroidManifest.xml:&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush: xml;"&gt;&lt;uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"&gt;&lt;/uses-permission&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;Find the correct local port for your Android emulator:&lt;/b&gt;&lt;br /&gt;
&lt;blockquote&gt;$ adb devices&lt;br /&gt;
List of devices attached&lt;br /&gt;
emulator-5554 device&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
The port we are looking for is in this case &lt;b&gt;5554&lt;/b&gt;. Now connect via &lt;b&gt;telnet&lt;/b&gt;:&lt;br /&gt;
&lt;blockquote&gt;$ telnet localhost 5554&lt;br /&gt;
Trying ::1...&lt;br /&gt;
Trying 127.0.0.1...&lt;br /&gt;
Connected to localhost.&lt;br /&gt;
Escape character is '^]'.&lt;br /&gt;
Android Console: type 'help' for a list of commands&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
&lt;b&gt;Set your preferred location manually: &lt;/b&gt;You set the location with the &lt;i&gt;geo fix&lt;/i&gt; command:&lt;br /&gt;
&lt;blockquote&gt;geo fix $longitude $latitude&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
For example the city center of Barcelona:&lt;br /&gt;
&lt;blockquote&gt;geo fix 2.169919 41.387917&lt;br /&gt;
OK&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
To get the latitude and longitude you want simply go to &lt;a href="http://maps.google.com/"&gt;http://maps.google.com&lt;/a&gt; on your computer's web browser, move the desired location to the center of your screen and simply enter this little JavaScript command into the address bar:&lt;br /&gt;
&lt;pre class="brush: jscript;"&gt;&lt;javascript:void(prompt('',gapplication.getmap().getcenter()));&gt;&lt;/javascript:void(prompt('',gapplication.getmap().getcenter()));&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;CAUTION:&lt;/b&gt; the format of the coordinates you get from Google Maps is (&lt;i&gt;$latitude, $longitude&lt;/i&gt;) - but the way you enter the &lt;i&gt;geo fix&lt;/i&gt; for Android has longitude and latitude switched around.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Make sure everything works properly:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Just launch the Google Maps application in your emulator. It should take you directly to the location you entered and display a blue blinking light. &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_K6NH2gxxhAc/Suw7T2gUGwI/AAAAAAAAEI0/oCa5uersUHk/s1600-h/mock_gps.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_K6NH2gxxhAc/Suw7T2gUGwI/AAAAAAAAEI0/oCa5uersUHk/s320/mock_gps.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Access Android's &lt;i&gt;Location Service&lt;/i&gt; in your application:&lt;/b&gt;&lt;br /&gt;
&lt;script class="brush: java" type="syntaxhighlighter"&gt;
&lt;![CDATA[
LocationManager mLocationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
Location myLocation = mLocationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
Double myLatitude = myLocation.getLatitude();
Double myLongitude = myLocation.getLongitude();
Log.i(TAG, "My location INIT: " + myLatitude + " | " + myLongitude);

Geocoder geocoder = new Geocoder(this);
java.util.List&lt;address&gt;


 addressList;
try {
 addressList = geocoder.getFromLocation(myLatitude, myLongitude, 5);
 if(addressList!=null &amp;amp;&amp;amp; addressList.size()&gt;0) {
  String address = new String();
  Log.i(TAG,addressList.get(0).toString());
  address = addressList.get(0).getAddressLine(0) + ", "
    + System.getProperty("line.separator")
    + addressList.get(0).getAddressLine(1)  + ", "
    + addressList.get(0).getAddressLine(2); 
  ((TextView)findViewById(R.id.CurrentLocation)).setText(address);
 }
 
} catch (IOException e) {
 e.printStackTrace();
}
]]&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Notes:&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;I noticed that sometimes the manully entered location dissolves. I haven't looked into that yet, but a workaround for now is to simply re-enter the location via the &lt;i&gt;geo fix&lt;/i&gt; command again.&lt;/li&gt;
&lt;li&gt;You always mix up latitude and longitude?&lt;/li&gt;

&lt;ul&gt;&lt;li&gt;&lt;b&gt;Latitude&lt;/b&gt;: goes from East&amp;lt;&amp;gt;West, like the rungs of a ladder (→ sounds similar to latitude)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Longitude&lt;/b&gt;: runs from North&amp;lt;&amp;gt;South. Think of the globe as a big, fat guy with a long (→ longitude) tie hanging down from the North Pole.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/380980011076825656-7577711239359640357?l=devstream.stefanklumpp.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devstream/~4/sAnrWPkAAc0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://devstream.stefanklumpp.com/feeds/7577711239359640357/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=380980011076825656&amp;postID=7577711239359640357&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/7577711239359640357?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/7577711239359640357?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devstream/~3/sAnrWPkAAc0/how-to-enable-fake-gps-on-android.html" title="How to enable fake GPS on Android" /><author><name>Stefan Klumpp</name><uri>http://www.blogger.com/profile/02899343387413244345</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="16104961862502439725" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_K6NH2gxxhAc/Suw7T2gUGwI/AAAAAAAAEI0/oCa5uersUHk/s72-c/mock_gps.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://devstream.stefanklumpp.com/2009/10/how-to-enable-fake-gps-on-android.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QGRH8zfSp7ImA9WxNVFUU.&quot;"><id>tag:blogger.com,1999:blog-380980011076825656.post-1072163221523388934</id><published>2009-10-26T10:47:00.006+01:00</published><updated>2009-10-26T20:28:45.185+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-26T20:28:45.185+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="click listener" /><category scheme="http://www.blogger.com/atom/ns#" term="Android" /><title>Android: easier click listeners in 1.6</title><content type="html">Romain guy just posted a really cool &lt;a href="http://android-developers.blogspot.com/2009/10/ui-framework-changes-in-android-16.html"&gt;improvement of button click listeners&lt;/a&gt; for the Android SDK 1.6 on the official &lt;a href="http://android-developers.blogspot.com/"&gt;Android Developers Blog&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Instead of having every time this recurring bunch of code to set up a simple click listener you can now just add &lt;pre class="brush: xml;"&gt;&amp;lt;Button android:onClick="myClickHandler" /&amp;gt;&lt;/pre&gt;to your button element in your layout's XML file.&lt;br /&gt;
&lt;br /&gt;
Finally the code to handle the click is as simple as that:&lt;br /&gt;
&lt;pre class="brush: java;"&gt;class MyActivity extends Activity {
  public void myClickHandler(View target) {
  // Do stuff
  }
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/380980011076825656-1072163221523388934?l=devstream.stefanklumpp.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devstream/~4/cbwZ7DvVlE0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://devstream.stefanklumpp.com/feeds/1072163221523388934/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=380980011076825656&amp;postID=1072163221523388934&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/1072163221523388934?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/1072163221523388934?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devstream/~3/cbwZ7DvVlE0/android-easier-click-listeners-in-16.html" title="Android: easier click listeners in 1.6" /><author><name>Stefan Klumpp</name><uri>http://www.blogger.com/profile/02899343387413244345</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="16104961862502439725" /></author><thr:total>0</thr:total><feedburner:origLink>http://devstream.stefanklumpp.com/2009/10/android-easier-click-listeners-in-16.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUDSH48eCp7ImA9WxNXGEg.&quot;"><id>tag:blogger.com,1999:blog-380980011076825656.post-1904927791648736935</id><published>2009-10-06T21:26:00.001+02:00</published><updated>2009-10-06T21:27:59.070+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-06T21:27:59.070+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Firefox" /><title>Wired-Marker (Firefox Add-on)</title><content type="html">A really cool Firefox add-on I recently stumbled upon: &lt;a href="http://www.wired-marker.org/en/"&gt;Wired-Marker&lt;/a&gt;&lt;br /&gt;
&lt;blockquote&gt;Wired-Marker is a permanent (indelible) &lt;b&gt;highlighter&lt;/b&gt; that you use on Web pages. The highlighter, which comes in various colors and styles, is a kind of electronic bookmark that serves as a guide when you revisit a Web page. The highlighted content is automatically recorded in a scrapbook and saved. &lt;br /&gt;
&lt;/blockquote&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_K6NH2gxxhAc/SsuYznuu0SI/AAAAAAAAD-c/0eeLJxUZWyg/s1600-h/image_preview_big.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_K6NH2gxxhAc/SsuYznuu0SI/AAAAAAAAD-c/0eeLJxUZWyg/s320/image_preview_big.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Surprisingly it wasn't really slowing down Firefox as I expected it to be. Maybe that is because all the information is stored in a &lt;b&gt;SQLite&lt;/b&gt; database, which also allows you to sync your markers between other computers by using a free &lt;b&gt;Online Storage Service&lt;/b&gt; like &lt;a href="https://www.getdropbox.com/"&gt;Dropbox&lt;/a&gt;. More details on how to set this up is &lt;a href="http://www.wired-marker.org/en/help_synchronize.html"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Wired-Marker is easy to &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/6219"&gt;install&lt;/a&gt; and to use, but it also offers a lot of different options for the more advanced user.&lt;br /&gt;
&lt;br /&gt;
Personally I prefer a minimalistic approach. I deleted the default preset markers and created just three simple markers with different colors and each linked to a keyboard shortcut:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style="background-color: yellow;"&gt;Yellow&lt;/span&gt; (ALT+C): just an &lt;b&gt;interesting word or line&lt;/b&gt; on a web page, which I want to emphasize from the the other content&lt;/li&gt;
&lt;li&gt;&lt;span style="background-color: orange;"&gt;Orange&lt;/span&gt; (ALT+D): &lt;b&gt;important stuff&lt;/b&gt;, which I wanna find quickly again.&lt;/li&gt;
&lt;li&gt;&lt;span style="background-color: lime;"&gt;Green&lt;/span&gt; (ALT+F): &lt;b&gt;follow-up&lt;/b&gt;, for an item that needs more time to continue reading or a lead I'd like to follow.&lt;/li&gt;
&lt;/ul&gt;Overall &lt;a href="http://www.wired-marker.org/en/"&gt;Wired-Marker&lt;/a&gt; is super simple, easy to install and to use. It quickly became one of my favorite daily tools, which I don't wanna miss any more.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/380980011076825656-1904927791648736935?l=devstream.stefanklumpp.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devstream/~4/skp_ekDN-Cg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://devstream.stefanklumpp.com/feeds/1904927791648736935/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=380980011076825656&amp;postID=1904927791648736935&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/1904927791648736935?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/1904927791648736935?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devstream/~3/skp_ekDN-Cg/wired-marker-firefox-add-on.html" title="Wired-Marker (Firefox Add-on)" /><author><name>Stefan Klumpp</name><uri>http://www.blogger.com/profile/02899343387413244345</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="16104961862502439725" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_K6NH2gxxhAc/SsuYznuu0SI/AAAAAAAAD-c/0eeLJxUZWyg/s72-c/image_preview_big.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://devstream.stefanklumpp.com/2009/10/wired-marker-firefox-add-on.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUYMQHk4eCp7ImA9WxBXEko.&quot;"><id>tag:blogger.com,1999:blog-380980011076825656.post-3288284584673331995</id><published>2009-10-05T00:34:00.006+02:00</published><updated>2010-01-23T19:59:41.730+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-23T19:59:41.730+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Symbolic Links" /><category scheme="http://www.blogger.com/atom/ns#" term="mklink" /><category scheme="http://www.blogger.com/atom/ns#" term="Junction Points" /><category scheme="http://www.blogger.com/atom/ns#" term="Command" /><category scheme="http://www.blogger.com/atom/ns#" term="Windows 7" /><title>Windows 7: Symbolic &amp; Hard Links</title><content type="html">If you are coming from the Linux world you are probably familiar with symbolic and hard links. I recently discovered a very similar feature implemented in the &lt;b&gt;NTFS file system&lt;/b&gt;, which enables you to create &lt;a href="http://en.wikipedia.org/wiki/NTFS_symbolic_link"&gt;Symbolic Links&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/NTFS_junction_point"&gt;Junction Points&lt;/a&gt; in Windows Vista and Windows 7 by utilizing the &lt;code&gt;mklink&lt;/code&gt; command.&lt;br /&gt;
&lt;br /&gt;
The &lt;code&gt;mklink&lt;/code&gt; command is used to create a symbolic link. It has the following command line syntax:&lt;br /&gt;
&lt;blockquote&gt;mklink [[/D] | [/H] | [/J]] link target&lt;br /&gt;
&lt;/blockquote&gt;&lt;div class="mw-geshi" dir="ltr" style="text-align: left;"&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;/D&lt;/code&gt; – Creates a &lt;b&gt;directory symbolic link&lt;/b&gt;. Can also point to a remote SMB network path.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/H&lt;/code&gt; – Creates a &lt;b&gt;hard link&lt;/b&gt; instead of a symbolic link.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/J&lt;/code&gt; – Creates a &lt;b&gt;Directory Junction&lt;/b&gt;. Can only point to directories on the same volume.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;If no arugement is specified, mklink creates a &lt;b&gt;file symbolic link&lt;/b&gt;.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;link&lt;/code&gt; – Specifies the new symbolic link name.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;target&lt;/code&gt; – Specifies the path (relative or absolute) that the new link refers to.&lt;/li&gt;
&lt;/ul&gt;Just like ordinary files and folders, &lt;code&gt;del&lt;/code&gt; and &lt;code&gt;rmdir&lt;/code&gt; can be used to delete the symbolic links to files and directories respectively.&lt;br /&gt;
To delete symbolic link to a file, the following command line syntax can be used:&lt;br /&gt;
&lt;blockquote&gt;del filename &lt;br /&gt;
&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;filename&lt;/code&gt; – Specifies the name of the file/symbolic link to be deleted&lt;/li&gt;
&lt;/ul&gt;To delete symbolic link to a folder, the following command line syntax can be used:&lt;br /&gt;
&lt;blockquote&gt;rmdir directoryname &lt;br /&gt;
&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;directoryname&lt;/code&gt; – Specifies the name of the folder/symbolic link to be deleted&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
For those who are interested here's a list of related articles with some more &lt;b&gt;background information&lt;/b&gt; about the NTFS file system, Symbolic Links and Junction Points:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-symbolic-links/"&gt;Junction Points and Symbolic Links&lt;/a&gt; [tuxera.com]&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.shell-shocked.org/article.php?id=284"&gt;Windows Symbolic and Hard Links&lt;/a&gt; [shell-shocked.org]&lt;/li&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/NTFS_junction_point"&gt;NTFS Junction Points&lt;/a&gt; [Wikipedia]&lt;/li&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/NTFS_symbolic_link"&gt;NTFS Symbolic Links&lt;/a&gt; [Wikipedia] &lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="http://ipggi.wordpress.com/2009/09/07/windows-file-junctions-symbolic-links-and-hard-links/"&gt;Windows File Junctions, Symbolic Links and Hard Links&lt;/a&gt; [ipggi.wordpress.com]&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.mydigitallife.info/2007/05/22/create-symbolic-links-hard-links-and-directory-junctions-in-vista-with-mklink/"&gt;Create Symbolic Links, Hard Links and Directory Junctions in Vista with MKLINK&lt;/a&gt;&amp;nbsp;[mydigitallife.info]&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/380980011076825656-3288284584673331995?l=devstream.stefanklumpp.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devstream/~4/l12KN62j7DI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://devstream.stefanklumpp.com/feeds/3288284584673331995/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=380980011076825656&amp;postID=3288284584673331995&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/3288284584673331995?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/380980011076825656/posts/default/3288284584673331995?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/devstream/~3/l12KN62j7DI/windows-7-symbolic-hard-links.html" title="Windows 7: Symbolic &amp; Hard Links" /><author><name>Stefan Klumpp</name><uri>http://www.blogger.com/profile/02899343387413244345</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="16104961862502439725" /></author><thr:total>1</thr:total><feedburner:origLink>http://devstream.stefanklumpp.com/2009/10/windows-7-symbolic-hard-links.html</feedburner:origLink></entry></feed>
