<?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>It's Just a Bunch of Stuff That Happens &#187; HOWTO</title>
	<atom:link href="http://stuffthathappens.com/blog/category/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://stuffthathappens.com/blog</link>
	<description>Technology and Geek Stuff by Eric Burke</description>
	<lastBuildDate>Fri, 04 Jun 2010 14:44:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Android Color Banding</title>
		<link>http://stuffthathappens.com/blog/2010/06/04/android-color-banding/</link>
		<comments>http://stuffthathappens.com/blog/2010/06/04/android-color-banding/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 14:44:50 +0000</pubDate>
		<dc:creator>Eric Burke</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[HOWTO]]></category>

		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1651</guid>
		<description><![CDATA[Many Android programmers encounter severe color banding on devices like the Nexus One. For example, here is a radial gradient in an app I wrote this morning.

There is an awful lot of misinformation out there, for example I see many people advocating dithering as a solution. Here is my app with dithering enabled:

This is better, [...]]]></description>
			<content:encoded><![CDATA[<p>Many Android programmers encounter severe color banding on devices like the Nexus One. For example, here is a radial gradient in an app I wrote this morning.</p>
<p><img src="http://stuffthathappens.com/blog/wp-content/uploads/2010/06/banding.png" alt="Banding on a Nexus One" title="Banding on a Nexus One" width="480" height="800" /></p>
<p>There is an awful lot of misinformation out there, for example I see many people advocating dithering as a solution. Here is my app with dithering enabled:</p>
<p><img src="http://stuffthathappens.com/blog/wp-content/uploads/2010/06/dithering.png" alt="Nexus One with Dithering" title="Nexus One with Dithering" width="480" height="800" class="alignnone size-full wp-image-1653" /></p>
<p>This is better, but won&#8217;t look so hot with many bitmaps. The correct solution is to take note of the format. As shown in the above images, Android&#8217;s default format is <code>PixelFormat.OPAQUE</code>. You can change this in a few ways. One way is to <a href="http://developer.android.com/resources/articles/window-bg-speed.html">create a custom theme</a> and set <code>android:windowBackground</code> to a color.</p>
<p>Another solution is to programmatically call <a href="http://developer.android.com/reference/android/view/Window.html#setFormat%28int%29">Window.setFormat(PixelFormat.RGBA_8888)</a>.</p>
<p>The end result:</p>
<p><img src="http://stuffthathappens.com/blog/wp-content/uploads/2010/06/argb8888.png" alt="Eliminating Color Banding on the Nexus One" title="Eliminating Color Banding on the Nexus One" width="480" height="800" class="alignnone size-full wp-image-1654" /></p>
<p>Sample code:</p>
<pre class="prettyprint">
public class MyActivity extends Activity {
  @Override
  public void onAttachedToWindow() {
    super.onAttachedToWindow();
    Window window = getWindow();
    // Eliminates color banding
    window.setFormat(PixelFormat.RGBA_8888);
  }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://stuffthathappens.com/blog/2010/06/04/android-color-banding/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Win 7 Printing to Airport Printer</title>
		<link>http://stuffthathappens.com/blog/2010/02/06/win-7-printing-to-airport-printer/</link>
		<comments>http://stuffthathappens.com/blog/2010/02/06/win-7-printing-to-airport-printer/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 16:47:55 +0000</pubDate>
		<dc:creator>Eric Burke</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1617</guid>
		<description><![CDATA[We have a combination of Mac and Windows machines in our house, and I was unable to get a new Windows 7 64-bit machine to print. The printer is shared using an Airport Extreme Base Station.
I downloaded Bonjour for Windows and it immediately detected the printer. Everything seemed OK, but printing always failed.
This led to [...]]]></description>
			<content:encoded><![CDATA[<p>We have a combination of Mac and Windows machines in our house, and I was unable to get a new Windows 7 64-bit machine to print. The printer is shared using an Airport Extreme Base Station.</p>
<p>I downloaded <a href="http://support.apple.com/downloads/Bonjour_for_Windows">Bonjour for Windows</a> and it immediately detected the printer. Everything seemed OK, but printing always failed.</p>
<p>This led to many hours of failed searching and troubleshooting. I found many people have the same problem, and many solutions being offered. Nothing worked, until I noticed the &#8220;here&#8221; link:</p>
<p><img src="http://stuffthathappens.com/blog/wp-content/uploads/2010/02/bonjour.png" alt="64-bit Bonjour" title="64-bit Bonjour" width="721" height="575" class="alignnone size-full wp-image-1618" /></p>
<p>With those highlighted circles, it seems painfully obvious. But the &#8220;download&#8221; button is more prominent, so I didn&#8217;t read the text. Based on the number of people I encountered having the exact same problem, I must not be the only one to miss this.</p>
<p>The real kicker is the fact that 32-bit Bonjour fails to warn you if you install it on a 64-bit PC. It happily finds the printer, leading to a false sense of success.</p>
<p>One last tip &#8212; if Bonjour can&#8217;t find the driver, first plug the printer directly into your PC. Windows should be able to download the right driver.</p>
]]></content:encoded>
			<wfw:commentRss>http://stuffthathappens.com/blog/2010/02/06/win-7-printing-to-airport-printer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Custom HTTP Headers with GWT RPC</title>
		<link>http://stuffthathappens.com/blog/2009/12/22/custom-http-headers-with-gwt-rpc/</link>
		<comments>http://stuffthathappens.com/blog/2009/12/22/custom-http-headers-with-gwt-rpc/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 20:09:36 +0000</pubDate>
		<dc:creator>Eric Burke</dc:creator>
				<category><![CDATA[GWT]]></category>
		<category><![CDATA[HOWTO]]></category>

		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1593</guid>
		<description><![CDATA[Prior to GWT 2.0, there was no easy way to add custom HTTP headers when making remote procedure calls. The new RpcRequestBuilder in GWT 2.0 makes it easy to add custom headers.
// start with a custom RpcRequestBuilder
RpcRequestBuilder reqBuilder = new RpcRequestBuilder() {
  @Override
  protected RequestBuilder doCreate(String serviceEntryPoint) {
    RequestBuilder rb [...]]]></description>
			<content:encoded><![CDATA[<p>Prior to GWT 2.0, there was no easy way to add custom HTTP headers when making remote procedure calls. The new <a href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/rpc/RpcRequestBuilder.html">RpcRequestBuilder</a> in GWT 2.0 makes it easy to add custom headers.</p>
<pre class="prettyprint">// start with a custom RpcRequestBuilder
RpcRequestBuilder reqBuilder = new RpcRequestBuilder() {
  @Override
  protected RequestBuilder doCreate(String serviceEntryPoint) {
    RequestBuilder rb = super.doCreate(serviceEntryPoint);
    rb.setHeader("username", "sookie_stackhouse");
    return rb;
  }
};

// as with any other RPC, use GWT.create(...) to generate the client proxy
MyServiceAsync service = (MyServiceAsync) GWT.create(MyService.class);

// all client proxies also implement ServiceDefTarget
((ServiceDefTarget) service).setRpcRequestBuilder(reqBuilder);

// make calls as normal
service.doFunAndInterestingThings();</pre>
]]></content:encoded>
			<wfw:commentRss>http://stuffthathappens.com/blog/2009/12/22/custom-http-headers-with-gwt-rpc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PNG Optimization</title>
		<link>http://stuffthathappens.com/blog/2009/10/11/png-optimization/</link>
		<comments>http://stuffthathappens.com/blog/2009/10/11/png-optimization/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 14:56:25 +0000</pubDate>
		<dc:creator>Eric Burke</dc:creator>
				<category><![CDATA[HOWTO]]></category>

		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1486</guid>
		<description><![CDATA[I am creating a large number of PNG files for an Android application and need to make the images as small as possible without losing quality.

After quite a bit of experimentation, I settled on these steps.

Create the original images in Illustrator

Use a limited number of colors
Avoid transparency
Avoid gradients
Create the images in the desired dimensions, 320&#215;480 [...]]]></description>
			<content:encoded><![CDATA[<p>I am creating a large number of PNG files for an Android application and need to make the images as small as possible without losing quality.</p>
<p><img src="http://stuffthathappens.com/blog/wp-content/uploads/2009/10/mo.png" alt="Missouri" title="Missouri" width="320" height="480" class="alignnone size-full wp-image-1487" /></p>
<p>After quite a bit of experimentation, I settled on these steps.</p>
<ol>
<li>Create the original images in Illustrator
<ul>
<li>Use a limited number of colors</li>
<li>Avoid transparency</li>
<li>Avoid gradients</li>
<li>Create the images in the desired dimensions, 320&#215;480 in my case (to avoid scaling artifacts when exporting)</li>
</ul>
</li>
<li>Export to 320&#215;480 PNG files</li>
<li>Use Gimp to convert to Indexed colors (Image -> Mode -> Indexed)
<ul>
<li>Generate optimized palette</li>
<li>Maximum number of colors = 48  (this works well for my particular images &#8212; it does NOT work well if you have gradients)</li>
<li>No color dithering</li>
</ul>
</li>
<li>Use <a href="http://www.amake.us/software/pngcrusher/">PNGCrusher</a> to reduce file size even more</li>
</ol>
<p><a href="http://www.amake.us/software/pngcrusher/">PNGCrusher</a> only helps a tiny bit since I already optimized in Gimp, but it can produce pretty dramatic results for non-optimized PNG files.</p>
]]></content:encoded>
			<wfw:commentRss>http://stuffthathappens.com/blog/2009/10/11/png-optimization/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.257 seconds -->

