Android Color Banding

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.

Banding on a Nexus One

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:

Nexus One with Dithering

This is better, but won’t look so hot with many bitmaps. The correct solution is to take note of the format. As shown in the above images, Android’s default format is PixelFormat.OPAQUE. You can change this in a few ways. One way is to create a custom theme and set android:windowBackground to a color.

Another solution is to programmatically call Window.setFormat(PixelFormat.RGBA_8888).

The end result:

Eliminating Color Banding on the Nexus One

Sample code:

 public class MyActivity extends Activity {   @Override   public void onAttachedToWindow() {     super.onAttachedToWindow();     Window window = getWindow();     // Eliminates color banding     window.setFormat(PixelFormat.RGBA_8888);   } } 

HTC EVO Review

The EVO is a great phone with poor software choices.

Like

  • The kickstand on the back
  • HDMI port
  • Front facing secondary camera
  • The huge display
  • Fast processor

Do Not Like

  • Pre-loaded apps on the system partition cannot be removed
    • Footprints, Friend Stream, HTC Mobile Guide, NASCAR Sprint Cup, Peep, Qik, Quickoffice, Sprint Football, Sprint Zone, Sprint Navigation, Sprint TV, and many others
    • Many of these apps are configured to automatically start, so less savvy users will experience reduced battery life and slower performance.
    • Even disabling and removing apps from the home screen leaves the “all applications” list cluttered.
  • The hardware buttons (home,menu,back,search) are easy to mistakenly hit. If you get a chance to try this phone, try tapping the bottom edge of the phone completely outside of the home button’s bounds. Your tap will still register!
  • The dialer is not Android standard. The HTC replacement is cluttered and harder to navigate.
  • The large size is nice, but the corners should be more rounded, like the Nexus One. The boxy shape of the EVO makes it feel even larger than it is.
  • The soft keyboard is not Android standard, and it is cluttered.
  • *** UPDATE: InputMethod full screen mode fails to show a “Next” button, even when android:imeOptions="actionNext" is specified as an EditText attribute. This means when users are entering text in landscape mode, they don’t see the Next button, resulting in a very confusing UI.
  • This phone has no trackball. When editing, you see a bunch of extra soft key arrows on the keyboard for navigation. These arrows add complexity:

HTC EVO Keyboard

Android makes vendor customizations possible and this phone demonstrates just how poorly that can be done.

State Capitals 1.1.2

I just fixed a few bugs in State Capitals:

  • I drew the Hawaii state capital star on the wrong island (epic oops)
  • The “Move Known States to Last” preference was ignored, so you could not disable that behavior

I also reworked the graphics for Alaska and Hawaii. These two cards now show the state positions relative to the lower-48 states.

Publishing to the Market

Once I built the StateCapitals.apk file, I decided to announce my progress on Twitter in real time. Here are my updates:

  • Update 1: OK, I just compiled a new build of State Capitals for #android. It is 12:45 PM and I am preparing to upload to the Market.
  • Update 2: It is 12:46PM and the upgrade is published. Now I’ll check my phone. #android
  • Update 3: Yep, 12:47 PM and I’m downloading the update to my phone. #android
  • Update 4: And by 12:48 PM I’ve tested my changes on my phone, all is well. #android

Three minutes was excessive. I had to pause between steps to post those messages to Twitter.

Contrast this experience with other app stores.

As always, State Capitals is free, has no advertisements, and requires zero permissions to run.

Android Storage

The new DROID phone only offers 256 MB for app storage, as Taylor Wimberly points out:

The Motorola Droid will be the most powerful Android phone to date when it launches on November 6, 2009. However, the device still features the same shortcomings of all other Android phones. The Droid ships with a 512 MB ROM which contains only 256 MB available for app storage.

Fair enough. From this starting point, the article quickly devolves into speculation and FUD:

Google does not support installing apps to the SD card (and likely never will), so developers are limited in what they can create.

I question the “and likely never will” claim. Google knows about the issue and I believe they will eventually resolve it. It’s been discussed in public Google forums, and I think people on the outside are assuming the worst. I think it is far more plausible that the Android team has limited resources and this is a very hard problem to solve correctly.

Limited In What We Can Create?

I also question the “…so developers are limited in what they can create.” portion of the above claim. He goes on:

Have you seen all the awesome iPhone and iPod Touch games? Hardly any of them would fit on an Android phone. It is not uncommon for popular titles to easily exceed 100 MB. For example, the game Myst takes up a whopping 727MB.

The solution is easy. Make your app small and download textures and graphics separately to the SD card.

In Summary…

  1. We all want the ability to download apps to the SD card
  2. Google knows about the issue and understands its importance
  3. Google has not officially committed to fixing the issue, or declared a timeline
  4. Without an official Google statement, many members of the Android community assume the worst

State Capitals 1.1.0

I just published a new version of State Capitals to the Android Market. If this were an iPhone app, who knows how long that process would take. On Android, the app is available within seconds of publication.

This version features one bug fix and completely new graphics. You can find it on the Android Market under the Applications -> Reference category.

Home Screen

The app does have menus to set configuration options, but everything else is through the touch screen. The new graphics show where the state resides and where the capital resides within each state.

Missouri

State Capitals is free (as in beer), and is also ad-free. Enjoy!

Android Mystery Box

Ed Burnette on the frustrating lack of Android transparency:

I expected Android 2.0, whenever it comes out, to have something more. But there’s no way for us on the outside to tell, especially if the changes are not visible in the few screenshots we manage to glimpse. Contrary to Google’s assurances, Android continues to be developed behind closed doors and then dumped on the community at the last minute. They could be releasing it as I write this, or it could come out next May. It could already be rock solid and production quality in a lab somewhere, or it could be buggy, incomplete, and not ready for prime time. We just don’t know. And that, my friends, is unacceptable for an open source project, even one with a commercial component.

Still, it’s light years better than Apple.

Android 1.6 on G1

Recently, people were speculating that Google (or T-Mobile) would not deliver Android version 1.6 to the G1 phone.

Today, T-Mobile pushed Android 1.6 to my G1 phone.