<?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>MaTT&#039;s Blog &#187; Android</title>
	<atom:link href="http://www.sep.com/mcterry/tag/android/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sep.com/mcterry</link>
	<description>...getting paid to be a nerd, and I&#039;m here to blog about it.</description>
	<lastBuildDate>Fri, 16 Dec 2011 04:18:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Get a list of Months by Locale in Android&#8230;</title>
		<link>http://www.sep.com/mcterry/2011/10/05/get-a-list-of-months-by-locale-in-android/</link>
		<comments>http://www.sep.com/mcterry/2011/10/05/get-a-list-of-months-by-locale-in-android/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 19:43:10 +0000</pubDate>
		<dc:creator>Matt Terry</dc:creator>
				<category><![CDATA[SEP Engineering]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[localization]]></category>

		<guid isPermaLink="false">http://www.sep.com/mcterry/?p=183</guid>
		<description><![CDATA[I was working with a client trying to decide on long and short DateFormats for an international mobile application.  (Yes, that&#8217;s a mouthful.) &#160; I wasn&#8217;t able to quickly find any documentation on the Java SimpleDateFormat strings by locale&#8230;so I did what any Passionate Programmer would do, and I wrote a method to do it [...]]]></description>
			<content:encoded><![CDATA[<p>I was working with a client trying to decide on long and short DateFormats for an international mobile application.  (Yes, that&#8217;s a mouthful.)</p>
<p>&nbsp;</p>
<p>I wasn&#8217;t able to quickly find any documentation on the Java SimpleDateFormat strings by locale&#8230;so I did what any <a href="http://pragprog.com/book/cfcar2/the-passionate-programmer">Passionate Programmer</a> would do, and I wrote a method to do it for me.</p>
<p>&nbsp;</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aoutputstreamwriter+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">OutputStreamWriter</span></a> out <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aoutputstreamwriter+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">OutputStreamWriter</span></a><span style="color: #009900;">&#40;</span>openFileOutput<span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;months-by-locale.txt&quot;</span>, <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Alocale+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Locale</span></a> l <span style="color: #339933;">:</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Alocale+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Locale</span></a>.<span style="color: #006633;">getAvailableLocales</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; out.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Locale = &quot;</span> <span style="color: #339933;">+</span> l.<span style="color: #006633;">getDisplayLanguage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;, &quot;</span> <span style="color: #339933;">+</span> l.<span style="color: #006633;">getDisplayCountry</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; out.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; out.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &nbsp; &nbsp;Long Months...&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; out.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> months <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adateformatsymbols+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">DateFormatSymbols</span></a><span style="color: #009900;">&#40;</span>l<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getMonths</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> m <span style="color: #339933;">:</span> months<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; out.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &nbsp; &nbsp; &nbsp; &nbsp;&quot;</span> <span style="color: #339933;">+</span> m<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; out.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; out.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; out.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &nbsp; &nbsp;Short Months...&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; out.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> smonths <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adateformatsymbols+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">DateFormatSymbols</span></a><span style="color: #009900;">&#40;</span>l<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getShortMonths</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> m <span style="color: #339933;">:</span> smonths<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; out.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &nbsp; &nbsp; &nbsp; &nbsp;&quot;</span> <span style="color: #339933;">+</span> m<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; out.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; out.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
out.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Then, I needed to get this file off of my emulator.  To do that, I opened the DDMS perspective, selected my emulator in the Devices tab (emulator-5554), and navigated to data\data\(applicaton name)\files\(file name).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sep.com/mcterry/2011/10/05/get-a-list-of-months-by-locale-in-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Handler, in a nutshell&#8230;</title>
		<link>http://www.sep.com/mcterry/2011/08/05/android-handler-in-a-nutshell/</link>
		<comments>http://www.sep.com/mcterry/2011/08/05/android-handler-in-a-nutshell/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 14:36:10 +0000</pubDate>
		<dc:creator>Matt Terry</dc:creator>
				<category><![CDATA[SEP Engineering]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[handler]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[thread]]></category>

		<guid isPermaLink="false">http://www.sep.com/mcterry/?p=137</guid>
		<description><![CDATA[The most basic way to handle multiple threads is to use the standard Java threads.  I won&#8217;t cover those in detail in this series; however, there are some good docs and examples online to help with those. By default, Android apps run solely in a single thread &#8211; the UI Thread.  For most applications, this [...]]]></description>
			<content:encoded><![CDATA[<p>The most basic way to handle multiple threads is to use the standard Java threads.  I won&#8217;t cover those in detail in this series; however, there are some good <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Thread.html" target="_blank">docs</a> and <a href="http://www.vogella.de/articles/JavaConcurrency/article.html#threads" target="_blank">examples</a> online to help with those.</p>
<p>By default, Android apps run solely in a single thread &#8211; the UI Thread.  For most applications, this is perfectly fine.  There are, however, some good reasons that your application needs to be multithreaded.  For example -</p>
<ul>
<li>lots of data access &#8211; reading/writing to a database is slow</li>
<li>download information from the internet &#8211; mobile networks can be spotty, or slow</li>
<li>sync with other components &#8211; for example, performing Bluetooth pairing or communicating with a service</li>
</ul>
<p>If you want your thread to be able to interact with the UI and still perform operations in the background, then you&#8217;ll need to use some Android specific classes.  The simplest form in Android is the <a href="http://developer.android.com/reference/android/os/Handler.html" target="_blank">Handler</a>.  A Handler allows you to send/queue messages, execute <a href="http://developer.android.com/reference/java/lang/Runnable.html" target="_blank">Runnable objects</a>, and even perform some fine grained scheduling.</p>
<p>One of the best uses for a Handler is for displaying progress.  When communicating progress via a dialog, or progress bar, or whatever, it is good to use a Handler because the user can still interact with your UI.  For example, if the user decides they don&#8217;t want to wait, they could press the back button.  Or, perhaps the operation you&#8217;re doing doesn&#8217;t require the user to wait, they can continue to use your app while information gets updated asynchronously.</p>
<p>Thinking of the G+, FB, or TweetDeck apps that try to backfill your stream&#8230;if those apps blocked your UI, and made you wait, you&#8217;d most likely never use those apps again.  Or worse, you might go as far as leaving negative feedback in the app store!</p>
<p style="padding-left: 30px"><strong>So, MaTT, how do we do this?</strong></p>
<p>The example below uses a Handler to set the progress on the UI.  So while the Thread is doing some lengthy operation (mProgressStatus = doWork();), the Handler is able to update the UI by calling the Post method, and setting the progress.</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>pre<span style="color: #339933;">&gt;</span>         <span style="color: #666666; font-style: italic;">// Start lengthy operation in a background thread</span><br />
         <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Athread+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Thread</span></a><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Arunnable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Runnable</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
             <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
                 <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>mProgressStatus <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
                     mProgressStatus <span style="color: #339933;">=</span> doWork<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
                     <span style="color: #666666; font-style: italic;">// Update the progress bar</span><br />
                     mHandler.<span style="color: #006633;">post</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Arunnable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Runnable</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
                         <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
                             mProgress.<span style="color: #006633;">setProgress</span><span style="color: #009900;">&#40;</span>mProgressStatus<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
                         <span style="color: #009900;">&#125;</span><br />
                     <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
                 <span style="color: #009900;">&#125;</span><br />
             <span style="color: #009900;">&#125;</span><br />
         <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;&lt;/</span>pre<span style="color: #339933;">&gt;</span></div></div>
<p>The reason you NEED a Handler here, is because you can&#8217;t access the UI from the Thread object.  The Android UI toolkit is not threadsafe by default.  If you try to access the View to update it, there is a good chance you&#8217;ll get some amazing Null Reference exceptions.</p>
<p>Each Activity only needs one handler, so you can use that Handler for different tasks or for updating multiple UI components.</p>
<p style="padding-left: 30px"><strong>So, MaTT, when do we use this?</strong></p>
<p>This approach is great for simple, yet long, operations.  You are still able to show progress to your user and you don&#8217;t block the UI while it happens.  Using Handlers won&#8217;t give you 5 stars in the market, but it can help keep you from getting 1 star.  Handlers are ideal for one-off situations where you need to do something, but don&#8217;t want to interrupt the user.  The other beautiful part about using a Handler is, you don&#8217;t have to worry about creating some complex messaging architecture that takes a week to develop and test.</p>
<p>If you find yourself putting Handlers all over the place, consider using a more robust solution like AsyncTasks which I will cover in more detail in my next post.</p>
<p>&nbsp;</p>
<p>Android Thread Series:</p>
<ol>
<li><a title="Too many options for Android threads?  Let me help!" href="http://www.sep.com/mcterry/2011/07/28/too-many-options-for-android-threads-let-me-help/">Overview</a></li>
<li><a title="Android Handler, in a nutshell..." href="http://www.sep.com/mcterry/2011/08/05/android-handler-in-a-nutshell/" target="_blank">Handlers</a></li>
<li>AsyncTasks</li>
<li>Services and Messengers</li>
<li>Conclusion</li>
</ol>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sep.com/mcterry/2011/08/05/android-handler-in-a-nutshell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Too many options for Android threads?  Let me help!</title>
		<link>http://www.sep.com/mcterry/2011/07/28/too-many-options-for-android-threads-let-me-help/</link>
		<comments>http://www.sep.com/mcterry/2011/07/28/too-many-options-for-android-threads-let-me-help/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 16:18:00 +0000</pubDate>
		<dc:creator>Matt Terry</dc:creator>
				<category><![CDATA[SEP Engineering]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[thread]]></category>

		<guid isPermaLink="false">http://www.sep.com/mcterry/?p=118</guid>
		<description><![CDATA[As smartphones continue to gain popularity, the demand for mobile applications also continues to grow.  The increase in usage of smartphones elevated the issue of &#8220;multitasking&#8221; on mobile devices.  (I&#8217;m not going to go into details of my opinions on the myth and illusion of multitasking.) Ultimately, users want to have multiple applications running, syncing [...]]]></description>
			<content:encoded><![CDATA[<p>As smartphones continue to <a title="Smartphone share" href="http://blog.nielsen.com/nielsenwire/online_mobile/in-us-smartphones-now-majority-of-new-cellphone-purchases/" target="_blank">gain popularity</a>, the demand for mobile applications also continues to grow.  The increase in usage of smartphones elevated the issue of &#8220;multitasking&#8221; on mobile devices.  (I&#8217;m not going to go into details of my opinions on the myth and illusion of multitasking.)</p>
<p>Ultimately, users want to have multiple applications running, syncing data, and connecting to the internet.</p>
<p>One solution to meet this demand is to block the UI and potentially display progress.  This can be a problem because users who perceive an application to be <a title="Design for responsiveness" href="http://developer.android.com/guide/practices/design/responsiveness.html" target="_blank">slow, sluggish, or non-responsive </a>will give your app poor reviews in the market.  A more ideal solution is to perform long running, slow, or blocking tasks in the background.  The same work is being done, but the UI is snappy, or responsive.  An added benefit is that you won&#8217;t end up having one of these gems while trying to get the latest news updates about the NFL Lockout&#8230; &lt;sigh/&gt;</p>
<p><a href="http://www.sep.com/mcterry/files/2011/07/anr.png"><img class="size-thumbnail wp-image-125 alignleft" src="http://www.sep.com/mcterry/files/2011/07/anr-150x150.png" alt="" width="150" height="150" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Android has many options for performing background tasks.  Specifically, Android gives you the opportunity to define what <a title="Processes and Threads" href="http://developer.android.com/guide/topics/fundamentals/processes-and-threads.html" target="_blank">process</a> your component runs in, control threads, and communicate remotely with components and processes.  Great!  Let&#8217;s use this to make awesome applications.  What&#8217;s the name of this magical background task thingy?  Well, get ready, because there&#8217;s a list&#8230;</p>
<ul>
<li>Process</li>
<li>Thread</li>
<li>Synchronized</li>
<li>Handler</li>
<li>Messenger</li>
<li>AsyncTask</li>
<li>Service</li>
<li>BoundServices</li>
<li>IntentServices</li>
</ul>
<p>In theory, this is great!  However, there are so many options that it can be overwhelming.  And you can&#8217;t just start moving everything to a new thread, because multithreaded applications introduce new challenges, like&#8230;</p>
<ul>
<li>What about concurrency?  Is that a problem? (That&#8217;s a rhetorical question.  Of course concurrency is an issue!)</li>
<li>Deadlock, livelock, and  starvation (&#8220;Oh my!&#8221;)</li>
<li>What do my users expect?  If I do things in the background, does that break the communication loop?</li>
<li>I&#8217;ve heard lifecycle is important, what does this mean?</li>
</ul>
<p>In a series of posts, I&#8217;ll cover the options, explain possible approaches, and make recommendations on when to use which options.  I will even put up some sample code to help illustrate my points.  Along the way, I will answer the above questions and more.  After all, you want to be sure that you&#8217;re using the right tool for the job, right?</p>
<p>&nbsp;</p>
<p>Android Thread Series:</p>
<ol>
<li><a title="Too many options for Android threads?  Let me help!" href="http://www.sep.com/mcterry/2011/07/28/too-many-options-for-android-threads-let-me-help/">Overview</a></li>
<li><a title="Android Handler, in a nutshell..." href="http://www.sep.com/mcterry/2011/08/05/android-handler-in-a-nutshell/" target="_blank">Handlers</a></li>
<li>AsyncTasks</li>
<li>Services and Messengers</li>
<li>Conclusion</li>
</ol>
<p>&nbsp;</p>
<ol></ol>
]]></content:encoded>
			<wfw:commentRss>http://www.sep.com/mcterry/2011/07/28/too-many-options-for-android-threads-let-me-help/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Developers&#8217; libraries&#8230;</title>
		<link>http://www.sep.com/mcterry/2010/03/01/developers-libraries/</link>
		<comments>http://www.sep.com/mcterry/2010/03/01/developers-libraries/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 19:54:09 +0000</pubDate>
		<dc:creator>Matt Terry</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[software documentation]]></category>
		<category><![CDATA[Symbian]]></category>

		<guid isPermaLink="false">http://www.sep.com/mcterry/?p=37</guid>
		<description><![CDATA[Being that my background is primarily with embedded software (namely, C and C++ w/o the .NET framework), I have not had much experience with online libraries. They seem awesome in theory, but for my application I struggled to see a need for them. And therefore, I was shocked at how much work people put into [...]]]></description>
			<content:encoded><![CDATA[<p>Being that my background is primarily with embedded software (namely, C and C++ w/o the .NET framework), I have not had much experience with online libraries.  They seem awesome in theory, but for my application I struggled to see a need for them.  And therefore, I was shocked at how much work people put into said libraries.</p>
<p>This was all true&#8230;until recently.  My 3 years of working on embedded projects here at SEP has ended, and now I have started helping with some of the early stages of a mobile app.</p>
<p>My domain is definitely NOT mobile, but I would say that it isn&#8217;t that drastic of a change.  And if my knowledge of software was in a <a href="http://en.wikipedia.org/wiki/Venn_diagram" target="_blank">Venn diagram</a> format, I don&#8217;t think object oriented programming would be in the center.</p>
<p>So, in order to be as helpful as possible on this new project&#8230;I decided to educate myself on the mobile platforms that we will be using &#8211; <a href="http://developer.android.com/reference/packages.html" target="_blank">Android</a>, <a href="http://developer.symbian.org/main/documentation/carbide/index.php" target="_blank">Symbian</a>, and of course&#8230;<a href="http://developer.apple.com/iphone/library/navigation/index.html" target="_blank">iPhone</a>.</p>
<p>There&#8217;s a lot of information out there.  Most of the time, I find myself going to multiple sites for that information, though.  One thing that has really impressed me so far is the work that all three of these platforms have done, in the way of documentation.</p>
<p>The Android library seems to be the most fluid, and easy to navigate.  All of the native packages and classes are easy to get to, and easy to read.  They even include examples of how each can be used.  Way cool, IMO!</p>
<p>The Symbian library seems to have a TON of information&#8230;literally.  It&#8217;s so much information, I find it difficult to find what it is I&#8217;m looking for.  Some of that might come with my lack of knowledge about the platform, though.  Under 1 site, we have documentation for the OS, APIs, hardware (and different versions), etc.  It&#8217;s quite the mother-load of information.</p>
<p>The iPhone library seems to be broken up into a completely different format.  Different being the key word.  Android chose to break it up by package and/or class.  iPhone seems to have a different method.  I&#8217;m sure I&#8217;ll like it better once I get neck deep into developing an app for the iPhone&#8230;but for now, I find it difficult.</p>
<p>To me, it is amazing how much time each company has invested into these libraries.  That&#8217;s not something that they are going to directly see any benefits from.  Immediately, you can tell that they are trying to make the developers happy!</p>
<p><a href="http://www.youtube.com/watch?v=Ra4JPZz3_Vo" target="_blank">&#8220;Daddy like&#8221;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sep.com/mcterry/2010/03/01/developers-libraries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

