<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>this.Reflect()</title>
	
	<link>http://blog.donnfelker.com</link>
	<description>The Technology Blog of Donn Felker</description>
	<lastBuildDate>Tue, 07 Sep 2010 02:18:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/donnfelker" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="donnfelker" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>HDC10: Hands-on-Lab – Project Solutions</title>
		<link>http://blog.donnfelker.com/2010/09/06/hdc10-hands-on-lab-project-solutions/</link>
		<comments>http://blog.donnfelker.com/2010/09/06/hdc10-hands-on-lab-project-solutions/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 02:17:40 +0000</pubDate>
		<dc:creator>Donn</dc:creator>
				<category><![CDATA[HDC]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://blog.donnfelker.com/?p=552</guid>
		<description><![CDATA[The hands on lab for this Wednesdays Build and Android app class are now online at GitHub. Download them here.
Download Details
Below are some details about the downloads that you&#8217;ll find on the HDC10 GitHub page.

HDC10 Hands on Lab
This is the master code for the final HDC10 application. This  application contains extra content that is <a href="http://blog.donnfelker.com/2010/09/06/hdc10-hands-on-lab-project-solutions/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>The hands on lab for this Wednesdays Build and Android app class are now online at GitHub. <a href="http://github.com/donnfelker/HDC10">Download them here</a>.</p>
<h1>Download Details</h1>
<p>Below are some details about the downloads that you&#8217;ll find on the<a href="http://github.com/donnfelker/HDC10"> HDC10 GitHub page</a>.</p>
<div>
<h2>HDC10 Hands on Lab</h2>
<p>This is the master code for the final HDC10 application. This  application contains extra content that is not covered in the  hands-on-lab. Download this source &#8211; <a href="http://github.com/donnfelker/HDC10/zipball/master">zip</a></p>
<h3>Extra Content</h3>
<ul>
<li>Menus</li>
<li>Dialogs</li>
<li>Custom Button Colors</li>
<li>Custom App Styling</li>
<li>XML Shape Definition</li>
</ul>
<h2>Module Content</h2>
<p>To select the module content, please select the appropriate branch below:</p>
<ul>
<li><a href="http://github.com/donnfelker/HDC10/tree/module1">Module 1 Solution &#8211; Splash Page and Website Activity</a> Download &#8211; <a href="http://github.com/donnfelker/HDC10/zipball/module1">zip</a></li>
<li><a href="http://github.com/donnfelker/HDC10/tree/module2">Module 2 Solution &#8211; Contact Page Activity</a> Download &#8211; <a href="http://github.com/donnfelker/HDC10/zipball/module2">zip</a></li>
<li><a href="http://github.com/donnfelker/HDC10/tree/module3">Module 3 Solution &#8211; Twitter Integration and AsyncTask&#8217;s</a> Download &#8211; <a href="http://github.com/donnfelker/HDC10/zipball/module3">zip</a></li>
</ul>
<h2>Resources</h2>
<p>If building the solution from scratch, you will need a few resources. These resources are located on the <a href="http://github.com/donnfelker/HDC10/tree/resources">resources branch</a> Download -<a href="http://github.com/donnfelker/HDC10/zipball/resources">zip</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.donnfelker.com/2010/09/06/hdc10-hands-on-lab-project-solutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Heartland Developers Conference – Next Week</title>
		<link>http://blog.donnfelker.com/2010/09/02/heartland-developers-conference-next-week/</link>
		<comments>http://blog.donnfelker.com/2010/09/02/heartland-developers-conference-next-week/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 21:02:24 +0000</pubDate>
		<dc:creator>Donn</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[HDC]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://blog.donnfelker.com/?p=544</guid>
		<description><![CDATA[Next Week I&#8217;ll be at the Heartland Developers conference with a bunch of other great presenters and colleagues.
Develop an Android Application With Me
On Wednesday I&#8217;ll be teaching a 4 hour lab on How to develop an Android Application. Sign up soon, as there are only a few tickets left for this class! The best part? <a href="http://blog.donnfelker.com/2010/09/02/heartland-developers-conference-next-week/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>Next Week I&#8217;ll be at the <a href="http://www.heartladdc.com" target="_blank">Heartland Developers</a> conference with a bunch of other great presenters and colleagues.</p>
<h2>Develop an Android Application With Me</h2>
<p>On Wednesday I&#8217;ll be teaching a 4 hour lab on <a href="http://www.heartlanddc.com/?page_id=334" target="_blank">How to develop an Android Application</a>. <a href="http://www.heartlanddc.com/?page_id=334" target="_blank">Sign up soon</a>, as there are only a few tickets left for this class! The best part? Its only <a href="http://hdc.eventbrite.com/" target="_blank">25 BUCKS</a>! Can&#8217;t beat 4 hours of instruction from a seasoned Android pro for so cheap!</p>
<p>I will be posting the links to the finished modules on my <a href="http://github.com/donnfelker">GitHub </a>page (as well as on here on my blog) in the coming days. This will allow you to see the code before we actually start writing it. You will be able to view each module as it is completed via the different branches in the Git repository. You don&#8217;t need to know Git, I&#8217;ll give you direct download links.</p>
<h2>Develop An Android Application Presentation</h2>
<p>Have prior engagements or simply can&#8217;t make the hands on lab? Then come down on Friday and check out my presentation on how to develop and Android application. I will be creating a new application in class and then posting it live to the Android Market. More info on this session can be <a href="http://www.heartlanddc.com/?page_id=468" target="_blank">found here.</a></p>
<h2>I&#8217;ll be in Omaha NE</h2>
<p>If you&#8217;d like to meet up during the week, before or after the conference to talk tech, enterprenuerial goodness, or just shoot-the-shiz &#8211; let me know. I&#8217;ll be hanging out downtown with the rest of the presenters and so forth. I&#8217;d love to meet you and interact.</p>
<h2>HDC10 Hash Tag</h2>
<p>Don&#8217;t forget, we&#8217;ll all be tweeting (presenters, attendees, sponsors, etc) about the event. Use the #HDC10 hash tag when tweeting about the event! It makes it easier to communicate. Feel free to follow me on twitter &#8211; <a href="http://www.twitter.com/donnfelker" target="_blank">@donnfelker</a></p>
<p>See you next week!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.donnfelker.com/2010/09/02/heartland-developers-conference-next-week/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ModelBinding ASP.NET MVC and Multiple Field Validation</title>
		<link>http://blog.donnfelker.com/2010/08/17/modelbinding-asp-net-mvc-and-multiple-field-validation/</link>
		<comments>http://blog.donnfelker.com/2010/08/17/modelbinding-asp-net-mvc-and-multiple-field-validation/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 20:03:42 +0000</pubDate>
		<dc:creator>Donn</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[MVC2]]></category>

		<guid isPermaLink="false">http://blog.donnfelker.com/?p=536</guid>
		<description><![CDATA[This tip comes to you from my blog, but the hat-tip goes to Andres Nelson whom I work with at my current client who actually showed me how to do this.
The Scenario
You have a grid with multiple fields. These fields are dependent upon each other. If one field is empty, then the other field is <a href="http://blog.donnfelker.com/2010/08/17/modelbinding-asp-net-mvc-and-multiple-field-validation/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>This tip comes to you from my blog, but the hat-tip goes to Andres Nelson whom I work with at my current client who actually showed me how to do this.</p>
<h3>The Scenario</h3>
<p>You have a grid with multiple fields. These fields are dependent upon each other. If one field is empty, then the other field is empty. At that point you want to display ONE error message informing the user that something is wrong, but you want to highlight both fields, as shown below in Figure 1-1. Please excuse the blurring of everything, but its NDA, you know how it goes. <img src='http://blog.donnfelker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Click for a larger view.</p>
<p><a href="http://blog.donnfelker.com/wp-content/uploads/2010/08/validation.jpg"><img class="alignleft size-medium wp-image-537" title="validation" src="http://blog.donnfelker.com/wp-content/uploads/2010/08/validation-300x57.jpg" alt="" width="300" height="57" /></a></p>
<pre><strong>Figure 1-1:</strong> Highlighting both fields, but providing one error message.</pre>
<h3>Solution</h3>
<p>I never thought of this, but its actually pretty simple, so again &#8211; hat tip to Andres. Simply add two ModelState errors, one for each property you want highlighted. However, for the second field, provide and empty string. MVC will not show that error in the validation summary, but the field will still get highlighted. Here&#8217;s the code -</p>
<pre class="brush: csharp;">

bindingContext.ModelState.AddModelError(&quot;Field1Name&quot;, &quot;Hey! Bad Stuffs Happens!&quot;);

// The one below will not show up in the validation summary, but the field will be highlighted.

bindingContext.ModelState.AddModelError(&quot;Field2Name&quot;, String.Empty);
</pre>
<p>That&#8217;s it!</p>
<p><img src="file:///C:/Users/dfelker/AppData/Local/Temp/moz-screenshot.png" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.donnfelker.com/2010/08/17/modelbinding-asp-net-mvc-and-multiple-field-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MacBook Pro – Windows 7 Boot to VHD</title>
		<link>http://blog.donnfelker.com/2010/08/17/macbook-pro-windows-7-boot-to-vhd/</link>
		<comments>http://blog.donnfelker.com/2010/08/17/macbook-pro-windows-7-boot-to-vhd/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 12:53:00 +0000</pubDate>
		<dc:creator>Donn</dc:creator>
				<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Virtual PC]]></category>
		<category><![CDATA[boottovhd]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[virtual]]></category>
		<category><![CDATA[windows7]]></category>

		<guid isPermaLink="false">http://blog.donnfelker.com/?p=530</guid>
		<description><![CDATA[Anyone who knows me personally knows that I run all of my work in a virtual environment. Back in 2009 when Hanselman posted about the Boot-to-VHD option of Windows 7, I had it up and running by the next morning. I&#8217;ve not stopped using it since.
My Setup
I have VHD&#8217;s for:

Different Clients &#8211; Therefore I can <a href="http://blog.donnfelker.com/2010/08/17/macbook-pro-windows-7-boot-to-vhd/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>Anyone who knows me personally knows that I run all of my work in a virtual environment. Back <a href="http://www.hanselman.com/blog/LessVirtualMoreMachineWindows7AndTheMagicOfBootToVHD.aspx">in 2009 when Hanselman posted about the Boot-to-VHD</a> option of Windows 7, I had it up and running by the next morning. I&#8217;ve not stopped using it since.</p>
<h3>My Setup</h3>
<p>I have VHD&#8217;s for:</p>
<ul>
<li>Different Clients &#8211; Therefore I can join their domain and have a computer (VHD) dedicated to their setup. Since each client usually requires a particular set up that normally conflicts (if I were running a single machine)  with another client, booting to a VHD allows me to have various configurations with different tools and sets up.</li>
<li>Beta products &#8211; I&#8217;m in the process of creating a Windows Phone 7 app, yet the tools are in Beta. We all know about Windows Tools and the &#8220;beta&#8221; work &#8211; AKA:Your stuff might come to a crashing halt. Therefore I have a couple VHDs for testing various environments and tools.</li>
<li>Android &#8211; I have a VHD that I use specifically for Android development.</li>
<li>Personal Use &#8211; Sometimes I need to develop code in VS2010 or Eclipse or RubyMine and would like it to be separate from the rest of the code I have. This is where I put this stuff.</li>
</ul>
<p>This process has worked great and I love booting to VHD, I think its one of the best things about Windows 7, hands down.</p>
<h3>Can I run it on a Mac?</h3>
<p>I&#8217;ve never been a Mac person until recently. My wife got a mac about a year ago and I&#8217;ve only used it to surf the web and fix some minor issues she had with printing. Other than that, I haven&#8217;t really touched it. However I have the need to develop iPhone and iPad apps as I&#8217;ve been getting a ton of inquires at <a href="http://www.agilevent.com">my mobile devleopment firm &#8211; Agilevent</a> to do so. My Dell D630 was on the way out (video card was pooping out on me) and it was time to buy a new PC before <a href="http://www.heartlanddc.com">Heartland Developers Conference</a>, which I&#8217;ll be presenting at in less than a month.</p>
<p>So, with some advice from <a href="http://aaronkardell.com/">Aaron Kardell</a> (thanks Aaron) I picked up a refurb MacBook pro from the Apple Store online.</p>
<h3>Booting to Windows and Creating a VHD</h3>
<p>I knew that with the MacBook Pro I could run Windows 7 (as it was Intel based). This was possible to do through <a href="http://www.apple.com/support/bootcamp/">Bootcamp</a>. This is something thousands of people do every day. Nothing big. However I wanted to install Windows 7, and then create multiple VHD&#8217;s for the MacBook pro environment. I followed the instructions in the Bootcamp documentation to set up Windows 7 on a different partition. I have a 500 GB HD, so I split the space equally between OSX and Windows 7. I then installed Windows 7 on the Windows partition.</p>
<p>When you boot a MacBook Pro with Bootcamp, you&#8217;ll get two options (if you hold down the options key on the Mac while booting). One is the Mac partition, the other is the Windows partition. I select the Windows partition to boot to Windows. Once I was able to do that, I followed <a href="http://www.hanselman.com/blog/LessVirtualMoreMachineWindows7AndTheMagicOfBootToVHD.aspx">Hanselman&#8217;s instructions</a> to create a 80GB expandable vdisk using diskpart after booting to the Windows 7 DVD. This allowed me to create a virtual disk which I was able to install Windows 7 to.</p>
<blockquote><p>When you select this new partition in the Window setup, it will warn you that you cannot (or likely should not) install windows because of possible driver issues. Blaaaah&#8230; nonsense, do it anyway. <img src='http://blog.donnfelker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p></blockquote>
<p>After I let the install rip for awhile it was done. The system did reboot a couple of times and here&#8217;s where the a small problem started. When I added the vdisk and attached it, Windows gave it the boot loader name of &#8220;Windows 7&#8243;. However my default instance was also named &#8220;Windows 7&#8243;. Therefore when I booted into Windows 7 I had TWO &#8220;Windows 7&#8243; options. I eventually figured out which one was the correct one &#8211; but watch out for this because it can be tricky.</p>
<h4>Fixing the Same Name Issue</h4>
<p>After everything is installed, you&#8217;ll want to go back into your default Windows 7 installation and fire up <strong>bcdedit </strong>from the command line.</p>
<p>Issue the command:</p>
<pre class="brush: csharp;">

bcdedit /v
</pre>
<p>This will show you all of the entries in the boot loader for Windows. On one of those you&#8217;ll see a path to your .vhd file. That one is your VHD boot. Grab the id (the long guid deal) and copy it to the clipboard. Then type the following command -</p>
<pre class="brush: csharp;">

bcdedit /set {GuidGoesHere} description &quot;VHD&quot;
</pre>
<p>Of course, replace the &#8220;GuidGoesHere&#8221; with the guid you copied from the previous step, also give it a different name other than VHD if you wish.</p>
<p>After that, issue another bcdedit /v command and you&#8217;ll see the name has changed. Now, when you reboot into the Windows partition you&#8217;ll see the following two options -</p>
<ul>
<li>Windows7</li>
<li>VHD</li>
</ul>
<h3>Creating Multiple VHD&#8217;s</h3>
<p>Once your VHD is set up, you&#8217;ll want to boot back into your default Windows 7 install and then copy the .vhd file somewhere safe. This will be your boilerplate Windows 7 install. At  a later time if you&#8217;d like to have ANOTHER VHD to boot from (maybe to test beta software, you go to a new client, etc), you can copy this same VHD into a new folder on the default Windows 7 install, perform the <strong>bcdedit </strong>commands to add the VHD to your boot loader (as listed in great detail in <a href="http://www.hanselman.com/blog/LessVirtualMoreMachineWindows7AndTheMagicOfBootToVHD.aspx">Hanselmans post</a>) and now you&#8217;d have three options to boot from:</p>
<ul>
<li>Windows7</li>
<li>VHD</li>
<li>&lt;YourNewEntryHere&gt;</li>
</ul>
<h3>Booting to the VHD</h3>
<p>To recap, I have a MacBook pro, which I&#8217;ve used Bootcamp to install Windows 7. Once that was installed I created a VHD (after choosing Windows 7 from the initial boot loading screen). I have created, perhaps, many VHD&#8217;s to boot to, and used the <strong>bcdedit </strong>tool to add them to my Windows boot loader options.</p>
<p>To boot the any of the VHD&#8217;s I perform the following steps -</p>
<ol>
<li>Power on the Macbook Pro while holding down the option key</li>
<li>Select the Windows Partition to boot into.</li>
<li>Once Windows start to boot I will receive an option of what Windows installation I want to boot into (the default &#8220;Windows7&#8243; or any of the VHD&#8217;s)</li>
<li>I select the VHD, and Windows starts, running with full hardware support*</li>
</ol>
<p>Its that simple. I can now copy over a new VHD, install some software and test it out.</p>
<p>* <strong>Drivers &amp; Full Hardware Support </strong>- Because the MacBook Pro hardware is different than a regular PC, you&#8217;ll need to put the OSX install CD into the drive and install the Bootcamp tools for Windows. This will install ALL of the hardware drivers you need. You will then be able to use the &#8220;command&#8221; key on the MacBook Pro keyboard AS the &#8220;Windows Key&#8221; as you would on a normal Windows keyboard. I advise that you install the Bootcamp tools and then create a copy of the VHD as your baseline/boilerplate VHD. This will allow you to quickly copy over the VHD and get up and running smoothly.</p>
<h3>Visualizing the VHD Install</h3>
<p>To help you understand what just happend, I&#8217;ve created the diagram in Figure 1-1 below. Click it for a larger view.</p>
<p><a href="http://blog.donnfelker.com/wp-content/uploads/2010/08/mbp_vhd.png"><img class="alignleft size-medium wp-image-532" title="mbp_vhd" src="http://blog.donnfelker.com/wp-content/uploads/2010/08/mbp_vhd-300x225.png" alt="MacBook Pro, Windows 7 and VHD" width="300" height="225" /></a></p>
<pre>Figure 1-1: Visualizing the VHD install. OSX and Windows are boot options. If booted to Windows 7, the other options then become available during the boot process of Windows
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.donnfelker.com/2010/08/17/macbook-pro-windows-7-boot-to-vhd/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Android Library Project Reference Not Showing</title>
		<link>http://blog.donnfelker.com/2010/08/13/android-library-project-reference-not-showing/</link>
		<comments>http://blog.donnfelker.com/2010/08/13/android-library-project-reference-not-showing/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 18:09:07 +0000</pubDate>
		<dc:creator>Donn</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://blog.donnfelker.com/?p=527</guid>
		<description><![CDATA[I previously posted about how you could make a free and lite version of your application using the Android Library project feature inside of Eclipse.
I set out to do this a few days ago with a client project that I had been working on. My development work flow went like this:

Build the entire app in <a href="http://blog.donnfelker.com/2010/08/13/android-library-project-reference-not-showing/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>I previously posted about how you could make a <a href="http://blog.donnfelker.com/2010/08/05/howto-android-full-and-lite-versions/">free and lite version of your application</a> using the Android Library project feature inside of Eclipse.</p>
<p>I set out to do this a few days ago with a client project that I had been working on. My development work flow went like this:</p>
<ol>
<li>Build the entire app in one project first. All features.</li>
<li>Turn the said app into a library</li>
<li>Build out the Full and Lite shells</li>
<li>Crank out the Full and Lite versions as APK&#8217;s so I can get them on the Android Market.</li>
</ol>
<h2>The Problem</h2>
<p>However, wen I got to part 3 I ran into an issue. The Android Project would not reference the Library. However, in the gen/ folder I could see that the R.java file was being generated by Eclipse with the resources from the referenced project. However, there was no referenced project icon and anytime I added anything to the ApplicationManifest.xml file Eclipse would complain that it could not find the class.</p>
<p>It seemed that Eclipse &#8216;knew&#8217; about the project because it could build the R.java file, but could not fully find it. It was somewhere in Eclipse limbo.</p>
<h2>Solution</h2>
<p>After about 6 hours of trying various things I figured out what the issue was.</p>
<p><strong>The problem: </strong>My projects in Eclipse had spaces in them (note, I&#8217;ve found that periods also cause a problem).</p>
<p>I changed the name of my projects to not have any spaces or punctuation in them. Such as &#8220;FooLibrary&#8221; instead of &#8220;Foo Library&#8221; or &#8220;Foo.Library&#8221;. Then I de-referenced the project, then referenced it again. It still would not show up. Sometimes restarting Eclipse can make everything &#8220;bind&#8221; again. Not sure why, but it seems to be a bug with the ADT plugin. Long story short, after restarting Eclipse, the referenced project was now available and working as it should.</p>
<p><em>Note, this is only the project name in Eclipse, not the Java package name. </em></p>
<h3>Conclusion</h3>
<p>Moral of the story &#8211; don&#8217;t use spaces, periods or any punctuation in your projects or libraries if you want to use Android Library Projects.</p>
<p>I wish the Android Documentation had a comment system so that I could post this there as it would have saved me 6 hours and a lot of frustration because spaces in the name of a project being the root cause is not too intuitive.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.donnfelker.com/2010/08/13/android-library-project-reference-not-showing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HowTo: Android – Full and Lite Versions</title>
		<link>http://blog.donnfelker.com/2010/08/05/howto-android-full-and-lite-versions/</link>
		<comments>http://blog.donnfelker.com/2010/08/05/howto-android-full-and-lite-versions/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 12:20:54 +0000</pubDate>
		<dc:creator>Donn</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://blog.donnfelker.com/?p=522</guid>
		<description><![CDATA[A full working code example of this post is located on my GitHub account here: http://github.com/donnfelker/FullAndLiteVersionSharedLibrary
I&#8217;m in the process of completing an Android app for a client and they needed the ability to have full and lite versions of the same application. The lite version would be free and the full version would be for <a href="http://blog.donnfelker.com/2010/08/05/howto-android-full-and-lite-versions/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>A full working code example of this post is located on my GitHub account here: <a href="http://github.com/donnfelker/FullAndLiteVersionSharedLibrary">http://github.com/donnfelker/FullAndLiteVersionSharedLibrary</a></p>
<p>I&#8217;m in the process of completing an Android app for a client and they needed the ability to have full and lite versions of the same application. The lite version would be free and the full version would be for a small fee (say, $2.99).</p>
<p>The Android Market stores applications based upon their unique Java package name. Therefore you cannot have multiple apps with the same package name. Therefore you&#8217;re left to do one of two things-</p>
<ol>
<li>Create two Android projects and copy the code, altering/removing/etc whatever is needed for the Lite/Full Version.</li>
<li>Manually recompile and change the package name each time you want to release each version.</li>
</ol>
<p>Either way its a real PITA. Which is why I&#8217;m writing this post. If you&#8217;re application requires Lite and Full versions (or more) then you&#8217;ll love this below.</p>
<h2>Android Project Libraries</h2>
<p>Android now has project libraries. This solves the problem of above. I now have the following package structure -</p>
<ul>
<li><strong>com.example.myapp</strong> &#8211; <em>Android Project Library </em>- This is where my ENTIRE app lives. All the functionality for the FULL and LITE versions.</li>
<li><strong>com.example.myapp.full </strong>- <em>Android Application Project </em>- This is a shell that contains graphics and resources needed for the full version only. Basically it&#8217;s a super lightweight shell.</li>
<li><strong>com.example.myapp.lite </strong>- <em>Android Application Project</em> &#8211; This is another shell that contains nothing but graphics and resources needed for the lite version. Again, its a super lightweight shell.</li>
</ul>
<h2>How To Determine Lite vs. Full</h2>
<p>In the <strong>com.example.myapp</strong>, I have an Application object that derives from the Android Application object. In this part of the app I check to see the package name contains the word &#8220;lite&#8221;. If so, then the app is running under a lite version. Here&#8217;s the code:</p>
<pre class="brush: java;">

return getPackageName().toLowerCase().contains(&quot;lite&quot;);&lt;/pre&gt;
</pre>
<p><strong>Whats Happening Here? </strong>The library project takes on the package name of the project that is referencing it. Therefore at runtime, the package name equates to-</p>
<p><em>com.example.myapp.lite</em></p>
<p>Therefore I know that I&#8217;m running under the context of my LITE app. I can now disable/enable a feature based upon that knowledge.</p>
<h2>Conclusion</h2>
<p>While this may be a quick and simple approach, it works. Now, inside of my main library (com.example.myapp), I can sprinkle if statements all over the place to determine if the app is the full or lite version. That way I can share a common code base and not have to worry about maintaining different, yet similar code bases.</p>
<h3>Downloads</h3>
<p><a href="http://github.com/donnfelker/FullAndLiteVersionSharedLibrary">Download a full working example here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.donnfelker.com/2010/08/05/howto-android-full-and-lite-versions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Android For Dummies &amp; TekPub</title>
		<link>http://blog.donnfelker.com/2010/07/22/android-for-dummies-tekpub/</link>
		<comments>http://blog.donnfelker.com/2010/07/22/android-for-dummies-tekpub/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 12:30:35 +0000</pubDate>
		<dc:creator>Donn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://blog.donnfelker.com/?p=517</guid>
		<description><![CDATA[My last post announced that I was writing a book &#8230; so &#8230;
What does this mean for the Introduction to Android TekPub.com series? 
Great things actually &#8211; if you prefer to learn via reading, you can do that with the book. If you prefer to learn via video, you can do that with Tekpub.com, all <a href="http://blog.donnfelker.com/2010/07/22/android-for-dummies-tekpub/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>My last post announced that I was writing a book &#8230; so &#8230;</p>
<p><strong>What does this mean for the Introduction to Android TekPub.com series? </strong></p>
<p>Great things actually &#8211; if you prefer to learn via reading, you can do that with the book. If you prefer to learn via video, you can do that with Tekpub.com, all via the same author. The book and the TekPub series cover different example applications so you&#8217;d get the most out of it by learning from both (in my opinion). Regardless, this will only enhance the learning for you by having two options &#8211; a book, or a video series.</p>
<p>More episodes of the TekPub series are coming soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.donnfelker.com/2010/07/22/android-for-dummies-tekpub/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Android Development For Dummies</title>
		<link>http://blog.donnfelker.com/2010/07/21/android-development-for-dummies/</link>
		<comments>http://blog.donnfelker.com/2010/07/21/android-development-for-dummies/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 12:26:21 +0000</pubDate>
		<dc:creator>Donn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://blog.donnfelker.com/?p=510</guid>
		<description><![CDATA[I can finally announce it, I&#8217;m writing the first official Android Application Development for Dummies book.
I&#8217;ve been writing for awhile now and had a lot of inquiries into what I&#8217;ve been writing about. I&#8217;m glad to finally be able to say what I&#8217;m working on.
The book is slated to be released this fall.
Pre-order now by <a href="http://blog.donnfelker.com/2010/07/21/android-development-for-dummies/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.com/gp/product/047077018X?ie=UTF8&amp;tag=donnfelker-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=047077018X" target="_blank"><img class="alignleft size-full wp-image-512" title="felker_android" src="http://blog.donnfelker.com/wp-content/uploads/2010/07/felker_android.png" alt="" width="245" height="300" /></a>I can finally announce it, I&#8217;m writing the first official <a href="http://www.amazon.com/gp/product/047077018X?ie=UTF8&amp;tag=donnfelker-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=047077018X" target="_blank">Android Application Development for Dummies </a>book.</p>
<p>I&#8217;ve been writing for awhile now and had a lot of inquiries into what I&#8217;ve been writing about. I&#8217;m glad to finally be able to say what I&#8217;m working on.</p>
<p>The book is slated to be released this fall.</p>
<p>Pre-order now by clicking on the image on the left.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.donnfelker.com/2010/07/21/android-development-for-dummies/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Android: ‘Must Override a Superclass Method’ Errors</title>
		<link>http://blog.donnfelker.com/2010/07/06/android-must-override-a-superclass-method-errors/</link>
		<comments>http://blog.donnfelker.com/2010/07/06/android-must-override-a-superclass-method-errors/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 13:05:05 +0000</pubDate>
		<dc:creator>Donn</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://blog.donnfelker.com/?p=507</guid>
		<description><![CDATA[I&#8217;ve been working by myself on all of my Android projects and just recently I need ed to expand my workforce to beyond that just myself. Therefore I needed to make my first hire for my company Agilevent. In doing so I needed to get my code over to another developers machine and I ran <a href="http://blog.donnfelker.com/2010/07/06/android-must-override-a-superclass-method-errors/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working by myself on all of my Android projects and just recently I need ed to expand my workforce to beyond that just myself. Therefore I needed to make my first hire for my company <a href="http://www.agilevent.com">Agilevent</a>. In doing so I needed to get my code over to another developers machine and I ran into all kinds of problems.</p>
<p><strong>Background</strong></p>
<p>The code is stored on GitHub in a private repository and the new developer had access. They had recently set up Eclipse and the ADT with Java 1.6. Everything was working golden. We could create a new project and everything worked fine. Except &#8230; when we tried to import the recently cloned GitHub project.</p>
<p>After importing Eclipse would report &#8220;Must Override a Superslass Method&#8221; on all kinds of methods all over the place (literally 86 different places in this one app).</p>
<p><strong>Resolution</strong></p>
<p>After a ton of futzing around we found the problem. Eclipse was defaulting to Java 1.5 for the imported project. I&#8217;m learning more and more and more about Java and its idiosyncrasies every day. In Java 1.5 classes can only be decorated with @Override when overriding a superclass method. In Java 1.6 if you have classes implementing interface methods you can decorate them with @Override and everything&#8217;s golden. You cant do that in 1.5. AKA: The source of the errors.</p>
<p>So where to change it?</p>
<p>Choose Window &#8211;&gt; Preferences &#8211;&gt; Java &#8211;&gt; Compiler and ensure 1.6 is selected in the Compiler Compliance Level. If that is set and you still have problems, then in the same window, choose &#8220;Configure Project Specific Settings &#8230;&#8221;, choose the project in the chooser, and enable the project specific settings checkbox and select 1.6 in the Compiler Compliance level.</p>
<p>Fun times. Now if I could only get those two hours back &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.donnfelker.com/2010/07/06/android-must-override-a-superclass-method-errors/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Gotchas with Rooting a MyTouch Slide</title>
		<link>http://blog.donnfelker.com/2010/06/29/gotchas-with-rooting-a-mytouch-slide/</link>
		<comments>http://blog.donnfelker.com/2010/06/29/gotchas-with-rooting-a-mytouch-slide/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 13:10:16 +0000</pubDate>
		<dc:creator>Donn</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://blog.donnfelker.com/?p=505</guid>
		<description><![CDATA[I got a hold of an extra MyTouch slide for testing and wanted to root it in order to put some a different ROM on there (namely Cyanogen). The MyTouch slide root instructions are fairly well documented and have worked for a lot of people. Unfortunately they did not work for me and I got <a href="http://blog.donnfelker.com/2010/06/29/gotchas-with-rooting-a-mytouch-slide/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>I got a hold of an extra MyTouch slide for testing and wanted to root it in order to put some a different ROM on there (namely Cyanogen). The <a href="http://forum.xda-developers.com/showthread.php?t=702973">MyTouch slide root instructions</a> are fairly well documented and have worked for a lot of people. Unfortunately they did not work for me and I got stuck where 90% of most people get stuck, in the &#8220;loop&#8221;. I was stuck in this mode for a week and nearly called it quits until I found this Gem last night. I could not get the loop to recognize my device as &#8220;offline&#8221;. Well, it would, but only for a split second.</p>
<p>I then found out why:</p>
<p>The instructions don&#8217;t point this out, and maybe this case is only due to my device but here goes:</p>
<ul>
<li>With the USB unplugged from the Phone and computer, Boot into HBOOT (with the phone off, press Power + the Down Volume). Then wait a second for the boot loader to try to find some images and then once its done navigate down to &#8220;recovery&#8221; (DO NOT GO INTO RECOVERY YET), so at this point &#8220;recovery&#8221; is just <em>highlighted. </em>Plug the USB into the phone, the <strong>other end of the USB should NOT be plugged into anything</strong>. So now you should have a phone with a USB cord connected/dangling not connected to the computer. <strong>Read this through, then do it:</strong> Now you will need to start the loop. Then as soon as you can, plug the USB into the computer. As soon (I mean lightning quick here people) as you feel the USB pop into place ENTER RECOVERY MODE (hit the power button). This has to be done before your phone recognizes that its plugged into the USB. As soon as the phone recognizes its in USB mode it will change from HBOOT to HBOOT with USB (or something like that, you&#8217;ll see it at the top of the screen in blue when in HBOOT). Notice: the switch from HBOOT to HBOOT WITH USB is almost instantaneous. Its about 1/2 of 1 second, its that quick. So AS SOON AS YOU feel the USB click (gotta be super fast people), enter recovery mode.</li>
<li><strong>I had to use the stock SD card that came with the phone, not a new/replacement one.</strong> Previously I had a 4 gig card in there from an old phone which was actually bought at Micro Center (had photos/files/etc on it). I read somewhere that you needed to use a stock SD card (I guess the types are different). Long story short: The new card I had in the phone did not allow it to show up as &#8220;offline&#8221;. I used the stock SD card and magically the phone started showing up in the loop immediately.</li>
</ul>
<p>That pretty much did it for me. I was able to root the phone, install other roms and then I went full circle and brought it back to factory settings with this <a href="http://forum.xda-developers.com/showthread.php?t=705345">ClockworkMod nandroid backup</a>.</p>
<p>So key points: Be fast with plugging in the USB and entering recovery mode. Use the stock SD card not some junk you bought from Micro Center (like me). <img src='http://blog.donnfelker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.donnfelker.com/2010/06/29/gotchas-with-rooting-a-mytouch-slide/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
