State Capitals 1.0.2

I released State Capitals version 1.0.2 tonight. This is an Android flash-card app for U.S. State Capitals.

To find it, just go to the Android Market and search for “State Capitals”.

This release does not add any new features. Instead, I focused on:

  • Improved performance
  • Reduced memory allocation, resulting in less garbage collection
  • Smoother animation

The animation is the biggest visible change. In the old version, a fling gesture moved to the previous or next card. My approach was:

  1. Use a standard Android animation to slide the activity to the left or right, depending on whether you were moving to the next or previous card
  2. At this point, you’d see a black screen. This is where I loaded the next bitmap, and the garbage collector generally ran
  3. Use another animation to slide the activity back onto the screen. (with the new bitmap)

If you’ve used the app, you also know I spin the card around using an animation. Every time onDraw(…) was called, I’d paint the card border, the state bitmap, and the text on top of the state. This made the code very inefficient.

The New Approach

In the new version, you can slide your finger on the screen, and the card moves with your finger. You also see the previous or next card directly adjacent to the current card.

I also generate a bitmap for the entire screen, and cache that bitmap. So when an animation occurs, I simply paint the cached bitmap.

Finally, I eliminated many memory allocations. For example:

  • I only save your settings when onPause(…) occurs. Before, I was writing to preferences every time something changed, which resulted in large numbers of object allocations
  • I eliminated several Lists and Maps, replacing them with simple arrays
  • I reuse the same Bitmap and Canvas objects over and over

If you want to learn more, check out “Google I/O 2009 – Writing Real-Time Games for Android”.

My focus on reduced object allocation is a direct result of watching that video, and it made a huge improvement to my app.

Internet Explorer 8

Microsoft sure stirred up some controversy with this browser comparison chart. Here is a picture, because I suspect they’ll take down that page fairly soon.

As several people mentioned on Twitter, the chart fails to include Opera or Safari. Plus, most of the items are highly subjective. This is obviously a marketing document, not a scientific comparison. We get it.

Lack of Trust

When IE first arrived, it had to compete with Netscape. Once they crushed the competition, Microsoft slept. For five years. They released IE 6 in 2001, and IE 7 in 2006.

Lack of competition hurt our industry and stifled innovation. Because of those five years, a lot of us simply do not trust Microsoft when it comes to browsers.


Thank goodness for the people behind Firefox, Opera, Safari, Chrome, and probably other browsers that I’m not thinking of. It is perfectly clear that Microsoft is now focused on improving Internet Explorer through better security, performance, and even standards compliance.

Good for them. IE 8 is their best effort yet.

Good for us. Web standards are good for us all.

But…I am skeptical.

Fool me once, shame on you. Fool me twice, shame on me.

Those five years cannot be swept under the rug with one new product release. Microsoft needs to earn back our trust. It will be hard, but not impossible.

What I Want

I want all of these browsers to compete, and to focus on web standards. Supporting today’s standards are an important first step for Microsoft, and I applaud their efforts.

To make up for the years lost with IE 6, Microsoft needs to do a lot more to win back my trust. I want Microsoft to boldly lead the way toward HTML 5, including support for embedded video, the canvas tag, native drag-and-drop to the browser, and more.

This means making standards-based browsers that will directly compete with proprietary plug-ins like Silverlight and Flash. Browser lock-in is old school. Proprietary plug-ins are old school. This video shows what I expect from my browser:

It would be wonderful if I could embed that video with a simple tag, but for now, that’s impossible. I eagerly await the day when that ugly <object …><embed… type=”application/x-shockwave-flash”> …</embed></object> crap is a distant memory.

Swiss Codemonkey: Avoid Them

Last week I installed a goofy app “Arnold Soundboard for Android” from Swiss Codemonkeys. I shouldn’t have, because the app requested network access.

Today, I received what appeared to be an SMS message. It had a little “thumbs-up” icon, and it said something like “A friend recommended an app!”. Clicking on the link brought me to the Android Market link for the Horoscope Widget, also from Swiss Codemonkeys.


I strongly suspect this message came from the Arnold Soundboard app, but I can’t really prove that. I did report it as a possible malicious app, and I recommend people avoid apps from Swiss Codemonkey. (or any other apps that request network access even when they don’t do anything network related).

If you are an application author, feel free to advertise your other apps. But don’t send messages pretending to be “recommendations” from alleged “friends”.