<?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>Honeycomb &#8211; Wiebe Elsinga</title>
	<atom:link href="http://wiebe-elsinga.com/blog/tag/honeycomb/feed/" rel="self" type="application/rss+xml" />
	<link>http://wiebe-elsinga.com/blog</link>
	<description>Blog</description>
	<lastBuildDate>Fri, 21 Oct 2011 04:18:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8</generator>
	<item>
		<title>Handlers and AsyncTasks, Android doing multithreading</title>
		<link>http://wiebe-elsinga.com/blog/handlers-and-asynctasks-android-doing-multithreading/</link>
					<comments>http://wiebe-elsinga.com/blog/handlers-and-asynctasks-android-doing-multithreading/#respond</comments>
		
		<dc:creator><![CDATA[W.Elsinga]]></dc:creator>
		<pubDate>Sun, 17 Jul 2011 22:50:35 +0000</pubDate>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[AsyncTask]]></category>
		<category><![CDATA[Honeycomb]]></category>
		<category><![CDATA[multithreading]]></category>
		<category><![CDATA[NetworkOnMainThreadException]]></category>
		<guid isPermaLink="false">http://wiebe-elsinga.com/blog/?p=690</guid>

					<description><![CDATA[Multithreading is always tricky. On any platform and in any language, when not implemented properly you will get unexpected behavior sooner or later. In the process of making an Android application suitable for Honeycomb, a colleague of mine ran into the NetworkOnMainThreadException, which is new in Honeycomb. On earlier Android versions, doing heavy operations on the main thread was strongly discouraged, but still possible. Now, the OS is forcing the developer to implement a proper application structure. Which isn&#8217;t a bad thing at all. So, to solve the NetworkOnMainThreadException, network and other heavy operations needed to move to a background thread. Considering the structure of the application, the most logical choice was to use the Handler in combination with a Thread. Basic setup HandlerThread Here is an example: public class MBOutcomeHandlerThread extends Thread &#123; &#160; public MBOutcomeHandlerThread&#40;String name&#41; &#160; &#123; &#160; &#160; super&#40;name&#41;; &#160; &#125; &#160; private MBOutcomeHandler _outcomeHandler; &#160; @Override &#160; public void run&#40;&#41; &#160; &#123; &#160; &#160; try &#160; &#160; &#123; &#160; &#160; &#160; Looper.prepare&#40;&#41;; &#160; &#160; &#160; _outcomeHandler = new MBOutcomeHandler&#40;&#41;; &#160; &#160; &#160; Looper.loop&#40;&#41;; &#160; &#160; &#125; &#160; &#160; catch &#40;Throwable e&#41; &#160; &#160; &#123; &#160; &#160; &#160; Log.e&#40;&#34;Log&#34;, &#34;Thread stopped due to error&#34;, e&#41;; &#160; &#160; &#125; &#160; &#125; &#160; public MBOutcomeHandler getOutcomeHandler&#40;&#41; &#160; &#123; &#160; &#160; return _outcomeHandler; &#160; &#125; &#125; Looper.prepare creates a new Looper instance for this thread, which then creates a new MessageQueue that Handlers can use to post messages on. MBOutcomeHandler is a subclass of Handler, which implements the handleMessage method. The constructor of the Handler class associates with the Looper. Looper.loop starts the Looper and keeps the thread alive. The Looper can be stopped by invoking Looper.quit. This will end run method of the Thread, hence, the Thread is finished. It is also possible to use the HandlerThread class. This class does the Looper setup for you. It doesn&#8217;t really matter which one you choose, as long as you don&#8217;t forget to instantiate the Handler inside the run method. When using the HandlerThread you must instantiate the Handler in the onLooperPrepared method. public class MBOutcomeHandlerThread extends HandlerThread &#123; &#160; private MBOutcomeHandler _outcomeHandler; &#160; public MBOutcomeHandlerThread&#40;String name&#41; &#160; &#123; &#160; &#160; super&#40;name&#41;; &#160; &#125; &#160; @Override &#160; public void run&#40;&#41; &#160; &#123; &#160; &#160; super.run&#40;&#41;; &#160; &#160; _outcomeHandler = null; &#160; &#125; &#160; @Override &#160; protected void onLooperPrepared&#40;&#41; &#160; &#123; &#160; &#160; _outcomeHandler = new MBOutcomeHandler&#40;&#41;; &#160; &#125; &#160; public MBOutcomeHandler getOutcomeHandler&#40;&#41; &#160; &#123; &#160; &#160; return _outcomeHandler; &#160; &#125; &#125; Now that we have a HandlerThread running, we can use the Handler to send messages to the Looper. Please be aware, that the HandlerThread keeps looping until the quit method is invoked. It doesn&#8217;t really matter if you use the instance of the HandlerThread, the Handler or the Looper. After the quit method is invoked, the HandlerThread is finished and cannot be started again. For example, if the HandlerThread has been quit because the Activity was pushed to the background, you need to clean up the HandlerThread in an onPause or onStop. When the Activity comes to the foreground again, a new HandlerThread must be created. Of course, the starting and stopping of the HandlerThread depends on what kind of operations are performed in the Handler. Then again, I think it is good practice to do a little clean up, instead of Android doing all the work. AsyncTasks After the new Handler was created, the next problem occurred. After pushing the application to the background and let it come to the foreground again, the application crashed because of the following error: Handler{4062bc78} sending message to a Handler on a dead thread. Because I was implementing a Handler, I assumed the exception had something to do with the Handler I created. After a lot of searching and debugging, the cause of the exception were the AsyncTasks that are used inside the Handler. Then, after reading the documentation of AsyncTask, Android is very clear that AsyncTasks must be created and started on the UI thread. But, in the process of moving code to the handler, that was overlooked. After creating and starting the AsyncTasks, everything worked fine! Recap HandlerThreads and Handlers are a great way to handle heavy or long during operations on a separate thread. When using AsyncTasks in your Handler, make sure that they&#8217;re created on the UI thread.]]></description>
										<content:encoded><![CDATA[<p>Multithreading is always tricky. On any platform and in any language, when not implemented properly you will get unexpected behavior sooner or later.</p>
<p>In the process of making an Android application suitable for Honeycomb, a colleague of mine ran into the <em>NetworkOnMainThreadException</em>, which is new in Honeycomb. On earlier Android versions, doing heavy operations on the main thread was strongly discouraged, but still possible. Now, the OS is forcing the developer to implement a proper application structure. Which isn&#8217;t a bad thing at all.</p>
<p>So, to solve the <em>NetworkOnMainThreadException</em>, network and other heavy operations needed to move to a background thread. Considering the structure of the application, the most logical choice was to use the <em>Handler</em> in combination with a <em>Thread</em>.<br />
<span id="more-690"></span></p>
<h4>Basic setup <em>HandlerThread</em></h4>
<p>Here is an example:</p>
<div class="codecolorer-container java blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:100%;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MBOutcomeHandlerThread <span style="color: #000000; font-weight: bold;">extends</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+thread"><span style="color: #003399;">Thread</span></a><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> MBOutcomeHandlerThread<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+string"><span style="color: #003399;">String</span></a> name<span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span>name<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> MBOutcomeHandler _outcomeHandler<span style="color: #339933;">;</span><br />
<br />
&nbsp; @Override<br />
&nbsp; <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><br />
&nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">try</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; Looper.<span style="color: #006633;">prepare</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; _outcomeHandler <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MBOutcomeHandler<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; Looper.<span style="color: #006633;">loop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+throwable"><span style="color: #003399;">Throwable</span></a> e<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; Log.<span style="color: #006633;">e</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Log&quot;</span>, <span style="color: #0000ff;">&quot;Thread stopped due to error&quot;</span>, e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> MBOutcomeHandler getOutcomeHandler<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> _outcomeHandler<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p><strong><em>Looper.prepare</em></strong> creates a new Looper instance for this thread, which then creates a new <em>MessageQueue</em> that <em>Handlers</em> can use to post messages on.</p>
<p><em>MBOutcomeHandler</em> is a subclass of <em>Handler</em>, which implements the <strong><em>handleMessage</em></strong> method. The constructor of the <em>Handler</em> class associates with the Looper.</p>
<p><em>Looper.loop</em> starts the Looper and keeps the thread alive. The Looper can be stopped by invoking <strong><em>Looper.quit</em></strong>. This will end run method of the Thread, hence, the Thread is finished.</p>
<p>It is also possible to use the <em>HandlerThread</em> class. This class does the Looper setup for you. It doesn&#8217;t really matter which one you choose, as long as you don&#8217;t forget to instantiate the <em>Handler</em> inside the run method. When using the <em>HandlerThread</em> you must instantiate the <em>Handler</em> in the <strong><em>onLooperPrepared</em></strong> method.</p>
<div class="codecolorer-container java blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:100%;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MBOutcomeHandlerThread <span style="color: #000000; font-weight: bold;">extends</span> HandlerThread<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> MBOutcomeHandler _outcomeHandler<span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> MBOutcomeHandlerThread<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+string"><span style="color: #003399;">String</span></a> name<span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span>name<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; @Override<br />
&nbsp; <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><br />
&nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">run</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; _outcomeHandler <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; @Override<br />
&nbsp; <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">void</span> onLooperPrepared<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; _outcomeHandler <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MBOutcomeHandler<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> MBOutcomeHandler getOutcomeHandler<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> _outcomeHandler<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Now that we have a <em>HandlerThread</em> running, we can use the <em>Handler</em> to send messages to the Looper.</p>
<p>Please be aware, that the <em>HandlerThread</em> keeps looping until the quit method is invoked. It doesn&#8217;t really matter if you use the instance of the <em>HandlerThread</em>, the <em>Handler</em> or the Looper. After the quit method is invoked, the <em>HandlerThread</em> is finished and cannot be started again. For example, if the <em>HandlerThread</em> has been quit because the Activity was pushed to the background, you need to clean up the <em>HandlerThread</em> in an <strong><em>onPause</em></strong> or <strong><em>onStop</em></strong>. When the Activity comes to the foreground again, a new <em>HandlerThread</em> must be created. Of course, the starting and stopping of the <em>HandlerThread</em> depends on what kind of operations are performed in the Handler. Then again, I think it is good practice to do a little clean up, instead of Android doing all the work.</p>
<h4>AsyncTasks</h4>
<p>After the new <em>Handler</em> was created, the next problem occurred. After pushing the application to the background and let it come to the foreground again, the application crashed because of the following error: <em>Handler{4062bc78}</em> sending message to a <em>Handler</em> on a dead thread. Because I was implementing a Handler, I assumed the exception had something to do with the Handler I created. After a lot of searching and debugging, the cause of the exception were the <em>AsyncTasks</em> that are used inside the Handler. Then, after reading the documentation of <em>AsyncTask</em>, Android is very clear that <em>AsyncTasks</em> must be created and started on the UI thread. But, in the process of moving code to the handler, that was overlooked. After creating and starting the <em>AsyncTasks</em>, everything worked fine!</p>
<h4>Recap</h4>
<p><em>HandlerThreads</em> and <em>Handlers</em> are a great way to handle heavy or long during operations on a separate thread. When using <em>AsyncTasks</em> in your Handler, make sure that they&#8217;re created on the UI thread. </p>
]]></content:encoded>
					
					<wfw:commentRss>http://wiebe-elsinga.com/blog/handlers-and-asynctasks-android-doing-multithreading/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How-To: Android emulator performance tuning tips</title>
		<link>http://wiebe-elsinga.com/blog/android-emulator-performance-tuning-tips/</link>
					<comments>http://wiebe-elsinga.com/blog/android-emulator-performance-tuning-tips/#comments</comments>
		
		<dc:creator><![CDATA[W.Elsinga]]></dc:creator>
		<pubDate>Sun, 10 Jul 2011 23:30:10 +0000</pubDate>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Emulator]]></category>
		<category><![CDATA[Honeycomb]]></category>
		<category><![CDATA[Tips]]></category>
		<guid isPermaLink="false">http://wiebe-elsinga.com/blog/?p=674</guid>

					<description><![CDATA[As some of you may already noticed, running Android Honeycomb application on the Android emulator, isn&#8217;t the most fun thing to do, because it&#8217;s painfully slow. Besides the start-up time (can be avoided, which I explain later), just using it is a pain. Google is planning to improve the performance, but if you can&#8217;t wait that long I’ve put together a few tips which may help improve your experience. &#8211; Emulated memory size. By default the Honeycomb AVD is created to emulate 256MB of RAM, my advice is to increase this significant, I’m using 1GB (1024MB). If you’re creating the AVD for Honeycomb in Eclipse you’ll find the RAM setting in the Hardware section under “Device ram size”. If you already have an AVD you can increase the setting by finding the directory you’re AVD is in (e.g. .android/avd/honeycomb.avd), editing the emulator-user.ini file, and changing hw.ramSize to whatever you want the ram size to be in MB. &#8211; Enable Snapshots. Enabling snapshots on an AVD allows the emulator to start-up an AVD in the state it was in when you closed it. This means that it doesn’t have to go through the boot-up procedure each time, which will save you a reasonable chunk of time. First on the initial launch make sure you select “Save to snapshot”. Get the emulator up and running and put it into the state you want. I like to have it start at the desktop (home screen) view. Now close the emulator. I found that it wasn’t very responsive when closing, so wait a bit, watch the mouse icon go to “busy” and let it write everything to disk. Now, launch the emulator again and this time uncheck “Save to snapshot” but make sure Launch from snapshot is chosen. Voila! The emulator launches quickly. And when you save it it shuts down quickly because it’s not saving anymore.]]></description>
										<content:encoded><![CDATA[<p>As some of you may already noticed, running Android Honeycomb application on the Android emulator, isn&#8217;t the most fun thing to do, because it&#8217;s painfully slow. Besides the start-up time (can be avoided, which I explain later), just using it is a pain. Google is planning to improve the performance, but if you can&#8217;t wait that long I’ve put together a few tips which may help improve your experience.<br />
<span id="more-674"></span><br />
&#8211; <em><strong>Emulated memory size</strong></em>.<br />
By default the Honeycomb <em>AVD</em> is created to emulate 256MB of RAM, my advice is to increase this significant, I’m using 1GB (1024MB).<br />
If you’re creating the <em>AVD</em> for Honeycomb in Eclipse you’ll find the RAM setting in the Hardware section under “<em>Device ram size</em>”. If you already have an <em>AVD</em> you can increase the setting by finding the directory you’re <em>AVD</em> is in (e.g. .android/avd/honeycomb.avd), editing the <em>emulator-user.ini</em> file, and changing <em>hw.ramSize</em> to whatever you want the ram size to be in MB.</p>
<p>&#8211; <em><strong>Enable Snapshots</strong></em>.<br />
Enabling snapshots on an <em>AVD</em> allows the emulator to start-up an <em>AVD</em> in the state it was in when you closed it. This means that it doesn’t have to go through the boot-up procedure each time, which will save you a reasonable chunk of time.<br />
First on the initial launch make sure you select “<em>Save to snapshot</em>”. Get the emulator up and running and put it into the state you want. I like to have it start at the desktop (home screen) view. Now close the emulator. I found that it wasn’t very responsive when closing, so wait a bit, watch the mouse icon go to “busy” and let it write everything to disk.<br />
Now, launch the emulator again and this time uncheck “<em>Save to snapshot</em>” but make sure Launch from snapshot is chosen. Voila! The emulator launches quickly. And when you save it it shuts down quickly because it’s not saving anymore.</p>
<p><a href="http://wiebe-elsinga.com/blog/wp-content/uploads/2011/07/snapshot_1.png" rel="lightbox[674]" title="snapshot_1"><img loading="lazy" class="size-medium wp-image-676 alignnone" title="snapshot_1" src="http://wiebe-elsinga.com/blog/wp-content/uploads/2011/07/snapshot_1-212x300.png" alt="" width="212" height="300" srcset="http://wiebe-elsinga.com/blog/wp-content/uploads/2011/07/snapshot_1-212x300.png 212w, http://wiebe-elsinga.com/blog/wp-content/uploads/2011/07/snapshot_1.png 259w" sizes="(max-width: 212px) 100vw, 212px" /></a> <a href="http://wiebe-elsinga.com/blog/wp-content/uploads/2011/07/snapshot_2.png" rel="lightbox[674]" title="snapshot_2"><img loading="lazy" class="size-medium wp-image-677 alignright" title="snapshot_2" src="http://wiebe-elsinga.com/blog/wp-content/uploads/2011/07/snapshot_2-212x300.png" alt="" width="212" height="300" srcset="http://wiebe-elsinga.com/blog/wp-content/uploads/2011/07/snapshot_2-212x300.png 212w, http://wiebe-elsinga.com/blog/wp-content/uploads/2011/07/snapshot_2-213x300.png 213w, http://wiebe-elsinga.com/blog/wp-content/uploads/2011/07/snapshot_2.png 259w" sizes="(max-width: 212px) 100vw, 212px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>http://wiebe-elsinga.com/blog/android-emulator-performance-tuning-tips/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Android and Google TV</title>
		<link>http://wiebe-elsinga.com/blog/android-and-google-tv/</link>
					<comments>http://wiebe-elsinga.com/blog/android-and-google-tv/#respond</comments>
		
		<dc:creator><![CDATA[W.Elsinga]]></dc:creator>
		<pubDate>Fri, 08 Apr 2011 05:10:37 +0000</pubDate>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Google TV]]></category>
		<category><![CDATA[Honeycomb]]></category>
		<guid isPermaLink="false">http://wiebe-elsinga.com/blog/?p=611</guid>

					<description><![CDATA[Watching what the sessions will be at the Google IO 2011, a couple of things stand out.. First, Android apps can be used by Google TV. Google TV already announced this at last year&#8217;s developer&#8217;s conference. Also on the agenda is a &#8220;Honeycomb highlights&#8221; session. It&#8217;s no great surprise that we&#8217;ll see more of the Android version that is first coming to tablets, supposedly in the first quarter of the year.]]></description>
										<content:encoded><![CDATA[<p>Watching what the sessions will be at the Google IO 2011, a couple of things stand out..</p>
<p>First, Android apps can be used by Google TV. Google TV already announced this at last year&#8217;s developer&#8217;s conference.</p>
<p>Also on the agenda is a  &#8220;Honeycomb highlights&#8221; session. It&#8217;s no great surprise that we&#8217;ll see  more of the Android version that is first coming to tablets, supposedly  in the first quarter of the year.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://wiebe-elsinga.com/blog/android-and-google-tv/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>The best Android tablets of 2011 compared with infographic</title>
		<link>http://wiebe-elsinga.com/blog/the-best-android-tablets-of-2011-compared-with-infographic/</link>
					<comments>http://wiebe-elsinga.com/blog/the-best-android-tablets-of-2011-compared-with-infographic/#comments</comments>
		
		<dc:creator><![CDATA[W.Elsinga]]></dc:creator>
		<pubDate>Wed, 06 Apr 2011 22:19:08 +0000</pubDate>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Honeycomb]]></category>
		<category><![CDATA[infographic]]></category>
		<category><![CDATA[tablet]]></category>
		<guid isPermaLink="false">http://wiebe-elsinga.com/blog/?p=603</guid>

					<description><![CDATA[The Android tablet market is being flooded with announcement of new Android 3.0 Honeycomb products for release this year. Up until now no one has taken on task of comparing all of them in one place. Well our friends over at Android Authority have done just that with a very detailed infographic. The chart pretty much speaks for itself and most all of the useful information is included. The next chart compares to the lower priced options available There you have a comparison off all the Android tablets that will be on the horizon during 2011. Which tablet are you keeping your eye on? Source Android Authority]]></description>
										<content:encoded><![CDATA[<p>The Android tablet market is being flooded with announcement of new Android 3.0 Honeycomb products for release this year. Up until now no one has taken on task of comparing all of them in one place. Well our friends over at Android Authority have done just that with a very detailed infographic.<br />
<span id="more-603"></span></p>
<p><img loading="lazy" alt="" src="http://androidheadlines.com/wp-content/uploads/2011/04/Best-Android-Tablets-Compared-2011-600x777.jpg" class="aligncenter" width="600" height="777" /></p>
<p>The chart pretty much speaks for itself and most all of the useful information is included. The next chart compares to the lower priced options available</p>
<p><img loading="lazy" alt="" src="http://androidheadlines.com/wp-content/uploads/2011/04/best-cheap-android-tablets-600x679.jpg" class="aligncenter" width="600" height="679" /></p>
<p>There you have a comparison off all the Android tablets that will be on the horizon during 2011. Which tablet are you keeping your eye on?</p>
<p><strong>Source</strong> <a target="_blank" href="http://www.androidauthority.com/the-best-android-tablets-of-2011-compared-spreadsheets-11841/">Android Authority</a></p>
]]></content:encoded>
					
					<wfw:commentRss>http://wiebe-elsinga.com/blog/the-best-android-tablets-of-2011-compared-with-infographic/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>How-To: Android Fragments</title>
		<link>http://wiebe-elsinga.com/blog/android-fragment/</link>
					<comments>http://wiebe-elsinga.com/blog/android-fragment/#comments</comments>
		
		<dc:creator><![CDATA[W.Elsinga]]></dc:creator>
		<pubDate>Tue, 22 Mar 2011 02:12:10 +0000</pubDate>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Fragment]]></category>
		<category><![CDATA[Honeycomb]]></category>
		<guid isPermaLink="false">http://wiebe-elsinga.com/blog/?p=578</guid>

					<description><![CDATA[Typically, an Android user interface is composed of views within layouts, such as a ListView within a LinearLayout. A hierarchy of View objects gets loaded or created when an Activity is started. On small screens, this is fine. But when you spread a UI out over the surface of a tablet&#8217;s screen, it calls for a different style of interaction. Some parts of the screen should remain constant over longer durations than others While developers can implement interactions where parts of the screen change by showing and hiding views, Android&#8217;s developers decided they needed more than just convention to encourage better large screen UIs and consistent implementation of the feel of the UI. Now, in order to facilitate this new kind of interaction, as part of the Android 3.0 SDK, we get a class called Fragment. A Fragment object is something between a View and and Activity: It can be part of a layout, but it isn&#8217;t a subclass of View. It implements the ComponentCallbacks interface, and it has a lifecycle, but that lifecycle is dependent on the Activity the Fragment object belongs to. Let&#8217;s see what it can do in a tablet-sized user interface. Here are the contents of the main.xml file that describes a screen layout for our application. In a list on the left of the screen some numbers will appear. Selecting a number from that list will create that many Android icons, displayed in a Fragment instance on the right. &#60;!--?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?--&#62; xmlns:android=&#34;http://schemas.android.com/apk/res/android&#34; android:orientation=&#34;horizontal&#34; android:layout_width=&#34;match_parent&#34; android:layout_height=&#34;match_parent&#34; android:id=&#34;@+id/frags&#34;&#62; android:id=&#34;@+id/number_list&#34; android:layout_width=&#34;250dip&#34; android:layout_height=&#34;match_parent&#34; /&#62; android:id=&#34;@+id/the_frag&#34; android:layout_width=&#34;match_parent&#34; android:layout_height=&#34;match_parent&#34; /&#62; The code for the Fragment subclass referred to in the layout in main.xml is below. package com.my; import android.app.Fragment; import android.content.Context; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; public class FragmentExample extends Fragment &#123; private int nAndroids; public FragmentExample&#40;&#41; &#123; &#125; /** * Constructor for being created explicitly */ public FragmentExample&#40;int nAndroids&#41; &#123; this.nAndroids = nAndroids; &#125; /** * If we are being created with saved state, restore our state */ @Override public void onCreate&#40;Bundle saved&#41; &#123; super.onCreate&#40;saved&#41;; if &#40;null != saved&#41; &#123; nAndroids = saved.getInt&#40;&#34;nAndroids&#34;&#41;; &#125; &#125; /** * Save the number of Androids to be displayed */ @Override public void onSaveInstanceState&#40;Bundle toSave&#41; &#123; toSave.putInt&#40;&#34;nAndroids&#34;, nAndroids&#41;; &#125; /** * Make a grid and fill it with n Androids */ @Override public View onCreateView&#40;LayoutInflater inflater, ViewGroup container, Bundle saved&#41; &#123; int n; Context c = getActivity&#40;&#41;.getApplicationContext&#40;&#41;; LinearLayout l = new LinearLayout&#40;c&#41;; for &#40;n = 0; n &#60; nAndroids; n++&#41; &#123; ImageView i = new ImageView&#40;c&#41;; i.setImageResource&#40;R.drawable.android&#41;; l.addView&#40;i&#41;; &#125; return l; &#125; &#125; package com.my; import android.app.Activity; import android.app.Fragment; import android.app.FragmentTransaction; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.AdapterView.OnItemClickListener; public class FragmentExampleActivity extends Activity implements OnItemClickListener &#123; /** Called when the activity is first created. */ @Override public void onCreate&#40;Bundle savedInstanceState&#41; &#123; super.onCreate&#40;savedInstanceState&#41;; setContentView&#40;R.layout.main&#41;; ListView l = &#40;ListView&#41; findViewById&#40;R.id.number_list&#41;; ArrayAdapter numbers = new ArrayAdapter&#40; getApplicationContext&#40;&#41;, android.R.layout.simple_list_item_1, new String&#91;&#93; &#123; &#34;one&#34;, &#34;two&#34;, &#34;three&#34;, &#34;four&#34;, &#34;five&#34;, &#34;six&#34; &#125;&#41;; l.setAdapter&#40;numbers&#41;; l.setOnItemClickListener&#40;this&#41;; &#125; /** * Add a Fragment to our stack with n Androids in it */ private void stackAFragment&#40;int nAndroids&#41; &#123; Fragment f = new FragmentExample&#40;nAndroids&#41;; FragmentTransaction ft = getFragmentManager&#40;&#41;.beginTransaction&#40;&#41;; ft.replace&#40;R.id.the_frag, f&#41;; ft.setTransition&#40;FragmentTransaction.TRANSIT_FRAGMENT_OPEN&#41;; ft.addToBackStack&#40;null&#41;; ft.commit&#40;&#41;; &#125; /** * Called when a number gets clicked */ public void onItemClick&#40;AdapterView&#60;!--?--&#62; parent, View view, int position, long id&#41; &#123; stackAFragment&#40;position + 1&#41;; &#125; &#125; This is what you see when you when you run the program: Initially, you see a list of numbers, and a blank area to the right. Touch a number, and a new Fragment is created, with the specified number of Android icons. If you keep touching numbers in the list on the left, the corresponding number of Android icons appears in the Fragment instance on the right. Now try the back button. Instead of returning to an instance of the Activity that was on the screen before this application launched, you see the previous Fragment instance on the right. That is, the Fragment objects have been integrated into the task&#8217;s back stack. Fragments are a new feature of Android, and this brief example only scratches the surface of how Fragment will change the way Android UIs are implemented. You can see from this example that using Fragments is efficient and expressive. You can read more about Fragment, and how it can be used alongside starting Activity objects to drill into detail views in an Android UI in an article by Dianne Hackborn, here. Download source code FragmentExample [19kB]]]></description>
										<content:encoded><![CDATA[<p>Typically, an Android user interface is composed of views within layouts, such as a ListView within a LinearLayout. A hierarchy of View objects gets loaded or created when an Activity is started. On small screens, this is fine.<br />
But when you spread a UI out over the surface of a tablet&#8217;s screen, it calls for a different style of interaction. Some parts of the screen should remain constant over longer durations than others</p>
<p>While developers can implement interactions where parts of the screen change by showing and hiding views, Android&#8217;s developers decided they needed more than just convention to encourage better large screen UIs and consistent implementation of the feel of the UI. Now, in order to facilitate this new kind of interaction, as part of the Android 3.0 SDK, we get a class called Fragment.<br />
<span id="more-578"></span><br />
A Fragment object is something between a View and and Activity: It can be part of a layout, but it isn&#8217;t a subclass of View.<br />
It implements the ComponentCallbacks interface, and it has a lifecycle, but that lifecycle is dependent on the Activity the Fragment object belongs to.<br />
Let&#8217;s see what it can do in a tablet-sized user interface.</p>
<p>Here are the contents of the <em>main.xml</em> file that describes a screen layout for our application. In a list on the left of the screen some numbers will appear. Selecting a number from that list will create that many Android icons, displayed in a Fragment instance on the right.</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #808080; font-style: italic;">&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?--&gt;</span><br />
xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br />
android:orientation=&quot;horizontal&quot;<br />
android:layout_width=&quot;match_parent&quot;<br />
android:layout_height=&quot;match_parent&quot;<br />
android:id=&quot;@+id/frags&quot;&gt;<br />
<br />
android:id=&quot;@+id/number_list&quot;<br />
android:layout_width=&quot;250dip&quot;<br />
android:layout_height=&quot;match_parent&quot; /&gt;<br />
<br />
android:id=&quot;@+id/the_frag&quot;<br />
android:layout_width=&quot;match_parent&quot;<br />
android:layout_height=&quot;match_parent&quot; /&gt;</div></div>
<p>The code for the Fragment subclass referred to in the layout in <em>main.xml</em> is below.</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:100%;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.my</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.app.Fragment</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.content.Context</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.os.Bundle</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.view.LayoutInflater</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.view.View</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.view.ViewGroup</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.ImageView</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.LinearLayout</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> FragmentExample <span style="color: #000000; font-weight: bold;">extends</span> Fragment <span style="color: #009900;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">int</span> nAndroids<span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">public</span> FragmentExample<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
* Constructor for being created explicitly<br />
*/</span><br />
<span style="color: #000000; font-weight: bold;">public</span> FragmentExample<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> nAndroids<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">nAndroids</span> <span style="color: #339933;">=</span> nAndroids<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
* If we are being created with saved state, restore our state<br />
*/</span><br />
@Override<br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onCreate<span style="color: #009900;">&#40;</span>Bundle saved<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">onCreate</span><span style="color: #009900;">&#40;</span>saved<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">null</span> <span style="color: #339933;">!=</span> saved<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
nAndroids <span style="color: #339933;">=</span> saved.<span style="color: #006633;">getInt</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;nAndroids&quot;</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 />
<br />
<span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
* Save the number of Androids to be displayed<br />
*/</span><br />
@Override<br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onSaveInstanceState<span style="color: #009900;">&#40;</span>Bundle toSave<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
toSave.<span style="color: #006633;">putInt</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;nAndroids&quot;</span>, nAndroids<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
* Make a grid and fill it with n Androids<br />
*/</span><br />
@Override<br />
<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+view"><span style="color: #003399;">View</span></a> onCreateView<span style="color: #009900;">&#40;</span>LayoutInflater inflater, ViewGroup container, Bundle saved<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #000066; font-weight: bold;">int</span> n<span style="color: #339933;">;</span><br />
<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+context"><span style="color: #003399;">Context</span></a> c <span style="color: #339933;">=</span> getActivity<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getApplicationContext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
LinearLayout l <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> LinearLayout<span style="color: #009900;">&#40;</span>c<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>n <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> n <span style="color: #339933;">&lt;</span> nAndroids<span style="color: #339933;">;</span> n<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
ImageView i <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ImageView<span style="color: #009900;">&#40;</span>c<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
i.<span style="color: #006633;">setImageResource</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">drawable</span>.<span style="color: #006633;">android</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
l.<span style="color: #006633;">addView</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">return</span> l<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:100%;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.my</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.app.Activity</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.app.Fragment</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.app.FragmentTransaction</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.os.Bundle</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.view.View</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.AdapterView</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.ArrayAdapter</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.ListView</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.AdapterView.OnItemClickListener</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> FragmentExampleActivity <span style="color: #000000; font-weight: bold;">extends</span> Activity <span style="color: #000000; font-weight: bold;">implements</span><br />
OnItemClickListener <span style="color: #009900;">&#123;</span><br />
<span style="color: #008000; font-style: italic; font-weight: bold;">/** Called when the activity is first created. */</span><br />
@Override<br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onCreate<span style="color: #009900;">&#40;</span>Bundle savedInstanceState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">onCreate</span><span style="color: #009900;">&#40;</span>savedInstanceState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
setContentView<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">layout</span>.<span style="color: #006633;">main</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+listview"><span style="color: #003399;">ListView</span></a> l <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+listview"><span style="color: #003399;">ListView</span></a><span style="color: #009900;">&#41;</span> findViewById<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">number_list</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
ArrayAdapter numbers <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ArrayAdapter<span style="color: #009900;">&#40;</span><br />
getApplicationContext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, android.<span style="color: #006633;">R</span>.<span style="color: #006633;">layout</span>.<span style="color: #006633;">simple_list_item_1</span>,<br />
<span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+string"><span style="color: #003399;">String</span></a><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;one&quot;</span>, <span style="color: #0000ff;">&quot;two&quot;</span>, <span style="color: #0000ff;">&quot;three&quot;</span>, <span style="color: #0000ff;">&quot;four&quot;</span>, <span style="color: #0000ff;">&quot;five&quot;</span>, <span style="color: #0000ff;">&quot;six&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
l.<span style="color: #006633;">setAdapter</span><span style="color: #009900;">&#40;</span>numbers<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
l.<span style="color: #006633;">setOnItemClickListener</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
* Add a Fragment to our stack with n Androids in it<br />
*/</span><br />
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> stackAFragment<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> nAndroids<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
Fragment f <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> FragmentExample<span style="color: #009900;">&#40;</span>nAndroids<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
FragmentTransaction ft <span style="color: #339933;">=</span> getFragmentManager<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">beginTransaction</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
ft.<span style="color: #006633;">replace</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">the_frag</span>, f<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
ft.<span style="color: #006633;">setTransition</span><span style="color: #009900;">&#40;</span>FragmentTransaction.<span style="color: #006633;">TRANSIT_FRAGMENT_OPEN</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
ft.<span style="color: #006633;">addToBackStack</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
ft.<span style="color: #006633;">commit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
* Called when a number gets clicked<br />
*/</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onItemClick<span style="color: #009900;">&#40;</span>AdapterView<span style="color: #339933;">&lt;!--?--&gt;</span> parent, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocs.oracle.com+javase+docs+api+view"><span style="color: #003399;">View</span></a> view, <span style="color: #000066; font-weight: bold;">int</span> position, <span style="color: #000066; font-weight: bold;">long</span> id<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
stackAFragment<span style="color: #009900;">&#40;</span>position <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</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></div></div>
<p>This is what you see when you when you run the program: Initially, you see a list of numbers, and a blank area to the right.</p>
<p><a href="http://wiebe-elsinga.com/blog/wp-content/uploads/2011/03/frag1.gif" rel="lightbox[578]" title="frag1"><img loading="lazy" class="aligncenter size-medium wp-image-581" title="frag1" src="http://wiebe-elsinga.com/blog/wp-content/uploads/2011/03/frag1-300x191.gif" alt="" width="300" height="191" srcset="http://wiebe-elsinga.com/blog/wp-content/uploads/2011/03/frag1-300x191.gif 300w, http://wiebe-elsinga.com/blog/wp-content/uploads/2011/03/frag1.gif 669w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Touch a number, and a new Fragment is created, with the specified number of Android icons. If you keep touching numbers in the list on the left, the corresponding number of Android icons appears in the Fragment instance on the right. Now try the back button. Instead of returning to an instance of the Activity that was on the screen before this application launched, you see the previous Fragment instance on the right. That is, the Fragment objects have been integrated into the task&#8217;s back stack.</p>
<p><a href="http://wiebe-elsinga.com/blog/wp-content/uploads/2011/03/frag2.gif" rel="lightbox[578]" title="frag2"><img loading="lazy" class="aligncenter size-medium wp-image-582" title="frag2" src="http://wiebe-elsinga.com/blog/wp-content/uploads/2011/03/frag2-300x192.gif" alt="" width="300" height="192" srcset="http://wiebe-elsinga.com/blog/wp-content/uploads/2011/03/frag2-300x193.gif 300w, http://wiebe-elsinga.com/blog/wp-content/uploads/2011/03/frag2.gif 666w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Fragments are a new feature of Android, and this brief example only scratches the surface of how Fragment will change the way Android UIs are implemented. You can see from this example that using Fragments is efficient and expressive.<br />
You can read more about Fragment, and how it can be used alongside starting Activity objects to drill into detail views in an Android UI in an article by Dianne Hackborn, <a href="http://android-developers.blogspot.com/2011/02/android-30-fragments-api.html">here</a>.</p>
<p>Download source code <a href="http://wiebe-elsinga.com/blog/wp-content/uploads/2011/03/FragmentExample.zip">FragmentExample</a> [19kB]</p>
]]></content:encoded>
					
					<wfw:commentRss>http://wiebe-elsinga.com/blog/android-fragment/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Android versions</title>
		<link>http://wiebe-elsinga.com/blog/android-versions/</link>
					<comments>http://wiebe-elsinga.com/blog/android-versions/#respond</comments>
		
		<dc:creator><![CDATA[W.Elsinga]]></dc:creator>
		<pubDate>Mon, 21 Mar 2011 01:24:27 +0000</pubDate>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Gingerbread]]></category>
		<category><![CDATA[Honeycomb]]></category>
		<guid isPermaLink="false">http://wiebe-elsinga.com/blog/?p=572</guid>

					<description><![CDATA[Google&#8217;s Android division certainly has a sense of humor as it named all their version codenames after desserts. So what are the different versions of Android OS, and the desserts associated with them? Noname 1.1 version There appears to be no codename assigned to Version 1.1 of Android OS. An update of Android, version 1.1, was released in February 2009. Android 1.5, a.k.a. Cupcake The first significant version of Android OS that really showcased the power of the platform is V1.5, codename &#8220;Cupcake&#8221;. Android 1.6, a.k.a. Donut Android V1.6, codename Donut, was released in September 2009. Android 2.0 / 2.1, a.k.a. Eclair Android V2.0 was released in October 2009, with a bugfix version 2.0.1 in December 2009. Android V2.1 was released January of 2010. Android 2.2, a.k.a. Froyo Android V2.2 was released in June 2010. Android 2.3, a.k.a. Gingerbread Android V2.3 was released in October 2010. Android 2.4/3.0, a.k.a. Honeycomb Is not out yet]]></description>
										<content:encoded><![CDATA[<p>Google&#8217;s Android division certainly has a sense of humor as it named all their version codenames after desserts. So what are the different versions of Android OS, and the desserts associated with them?<br />
<span id="more-572"></span></p>
<ul>
<li><strong>Noname 1.1 version</strong><br />
There appears to be no codename assigned to Version 1.1 of Android OS. An update of Android, version 1.1, was released in February 2009.</li>
<li><strong>Android 1.5, a.k.a. Cupcake</strong><br />
The first significant version of Android OS that really showcased the power of the platform is V1.5, codename &#8220;Cupcake&#8221;.</li>
<li><strong>Android 1.6, a.k.a. Donut</strong><br />
Android V1.6, codename Donut, was released in September 2009.</li>
<li><strong>Android 2.0 / 2.1, a.k.a. Eclair</strong><br />
Android V2.0 was released in October 2009, with a bugfix version 2.0.1 in December 2009. Android V2.1 was released January of 2010.</li>
<li><strong>Android 2.2, a.k.a. Froyo</strong><br />
Android V2.2 was released in June 2010.</li>
<li><strong>Android 2.3, a.k.a. Gingerbread</strong><br />
Android V2.3 was released in October 2010.</li>
<li><strong>Android 2.4/3.0, a.k.a. Honeycomb</strong><br />
Is not out yet</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>http://wiebe-elsinga.com/blog/android-versions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>A closer look at Android 3.0 (Honeycomb)</title>
		<link>http://wiebe-elsinga.com/blog/a-closer-look-at-android-3-0-honeycomb/</link>
					<comments>http://wiebe-elsinga.com/blog/a-closer-look-at-android-3-0-honeycomb/#respond</comments>
		
		<dc:creator><![CDATA[W.Elsinga]]></dc:creator>
		<pubDate>Mon, 21 Mar 2011 00:32:15 +0000</pubDate>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Features]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Honeycomb]]></category>
		<guid isPermaLink="false">http://wiebe-elsinga.com/blog/?p=566</guid>

					<description><![CDATA[Google has released its Android 3.0 (Honeycomb) software development kit (SDK) preview, allowing mobile developers to get an early hands-on with what the first tablet-only version of the Android operating system has to offer. So let&#8217;s take a closer look For Testing Only The SDK offers non-final APIs and is for testing purposes only. Google says its release is intended to allow developers time to familiarize themselves with the new UI patterns, APIs and capabilities. One thing I have notist, it&#8217;s extremely slow. If you&#8217;re just curious about its insides and don&#8217;t need to test anything yourself, it may be better to just stick with the news and forum postings for now Honeycomb for Users The new features for users in Honeycomb are detailed on the Android Developers website. To summarize, those are as follows: System Bar: The notifications bar from the Android phone has been transformed into a &#8220;System Bar,&#8221; which now lives at the bottom of the screen. From here, you can access notifications, system status and the soft navigation buttons (Back, Home and Recent Apps). Action Bar: The Menu area from Android phones has become the Action Bar on Honeycomb. Now at the top of the screen, this bar provides access to the contextual options, navigation, widgets and other content, as dictated by the application currently running. Customizable Homescreens: Honeycomb comes with five customizable homescreens which users can add widgets, app shortcuts and wallpapers to. Each homescreens offers a launcher for access to all the applications and search box for apps, contacts, media files, Web content and more Recent Apps New Keyboard: Honeycomb&#8217;s soft keyboard offers reshaped keys which have been repositioned for better targeting. New keys, including Tab for example, have been added, too. Better Copy-and-Paste: The copy/paste functionality has been given an upgrade too. Connectivity Options: Honeycomb offers built-in support for the Media/Photo Transfer Protocol, which lets you sync with a USB-connected camera. You can also attach USB or Bluetooth keyboards. Bluetooth tethering is supported and Wi-Fi connectivity has been improved. New Standard Apps: Also new in Honeycomb are major updates to the standard Android applications, the Browser, Camera and Gallery, Contacts apps and Email. Honeycomb for Developers Developers need to be aware of the following features: UI framework for creating great apps for larger screen devices High-performance 2D and 3D graphics: A new property-based animation framework lets developers add great visual effects to their apps. A built-in GL renderer lets developers request hardware-acceleration of common 2D rendering operations in their apps, across the entire app or only in specific activities or views. For adding rich 3D scenes, developers take advantage of a new 3D graphics engine called Renderscript. Support for multicore processor architectures: Honeycomb is optimized to run on either single- or dual-core processors, so that applications run with the best possible performance. Rich multimedia: New multimedia features such as HTTP Live streaming support, a pluggable DRM framework, and easy media file transfer through MTP/PTP, give developers new ways to bring rich content to users. New types of connectivity. Enhancements for enterprise: New administrative policies, such as for encrypted storage and password expiration, help enterprise administrators manage devices more effectively. Source Readwriteweb..com Source Developer.android.com]]></description>
										<content:encoded><![CDATA[<p>Google has released its Android 3.0 (Honeycomb) software development kit (SDK) preview, allowing mobile developers to get an early hands-on with what the first tablet-only version of the Android operating system has to offer. So let&#8217;s take a closer look</p>
<p><span id="more-566"></span></p>
<h4>For Testing Only</h4>
<p>The SDK offers non-final APIs and is for testing purposes only.<br />
Google says its release is intended to allow developers time to familiarize themselves with the new UI patterns, APIs and capabilities. One thing I have notist, it&#8217;s extremely slow. If you&#8217;re just curious about its insides and don&#8217;t need to test anything yourself, it may be better to just stick with the news and forum postings for now</p>
<h4>Honeycomb for Users</h4>
<p>The new features for users in Honeycomb are detailed on the Android Developers website. To summarize, those are as follows:</p>
<ul>
<li><strong>System Bar</strong>: The notifications bar from the Android phone has been transformed into a &#8220;System Bar,&#8221; which now lives at the bottom of the screen. From here, you can access notifications, system status and the soft navigation buttons (Back, Home and Recent Apps).</li>
<li><strong>Action Bar</strong>: The Menu area from Android phones has become the Action Bar on Honeycomb. Now at the top of the screen, this bar provides access to the contextual options, navigation, widgets and other content, as dictated by the application currently running.</li>
<li><strong>Customizable Homescreens</strong>: Honeycomb comes with five customizable homescreens which users can add widgets, app shortcuts and wallpapers to. Each homescreens offers a launcher for access to all the applications and search box for apps, contacts, media files, Web content and more</li>
<li><strong>Recent Apps</strong></li>
<li><strong>New Keyboard</strong>: Honeycomb&#8217;s soft keyboard offers reshaped keys which have been repositioned for better targeting. New keys, including Tab for example, have been added, too.</li>
<li><strong>Better Copy-and-Paste</strong>: The copy/paste functionality has been given an upgrade too.</li>
<li><strong>Connectivity Options</strong>: Honeycomb offers built-in support for the Media/Photo Transfer Protocol, which lets you sync with a USB-connected camera. You can also attach USB or Bluetooth keyboards. Bluetooth tethering is supported and Wi-Fi connectivity has been improved.</li>
<li><strong>New Standard Apps</strong>: Also new in Honeycomb are major updates to the standard Android applications, the Browser, Camera and Gallery, Contacts apps and Email.</li>
</ul>
<h4>Honeycomb for Developers</h4>
<p>Developers need to be aware of the following features:</p>
<ul>
<li><strong>UI framework for creating great apps for larger screen devices</strong></li>
<li><strong>High-performance 2D and 3D graphics</strong>: A new property-based animation framework lets developers add great visual effects to their apps. A built-in GL renderer lets developers request hardware-acceleration of common 2D rendering operations in their apps, across the entire app or only in specific activities or views. For adding rich 3D scenes, developers take advantage of a new 3D graphics engine called Renderscript.</li>
<li><strong>Support for multicore processor architectures</strong>: Honeycomb is optimized to run on either single- or dual-core processors, so that applications run with the best possible performance.</li>
<li><strong>Rich multimedia</strong>: New multimedia features such as HTTP Live streaming support, a pluggable DRM framework, and easy media file transfer through MTP/PTP, give developers new ways to bring rich content to users.</li>
<li><strong>New types of connectivity</strong>.</li>
<li><strong>Enhancements for enterprise</strong>: New administrative policies, such as for encrypted storage and password expiration, help enterprise administrators manage devices more effectively.</li>
</ul>
<p><strong>Source</strong> <a href="http://www.readwriteweb.com" target="_blank">Readwriteweb..com</a><br />
<strong>Source</strong> <a href="http://developer.android.com/sdk/android-3.0-highlights.html" target="_blank">Developer.android.com</a></p>
]]></content:encoded>
					
					<wfw:commentRss>http://wiebe-elsinga.com/blog/a-closer-look-at-android-3-0-honeycomb/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
