Rounds on tablets.
I use the extra space for a scoreboard in Rounds. It has large text so everyone can see who's winning. The Nexus 7 made me do it!…
I use the extra space for a scoreboard in Rounds. It has large text so everyone can see who's winning. The Nexus 7 made me do it!…
My Score Pad app, Rounds has been on the Play store for a full month. It received some nice media coverage from All About Android and Holo Everywhere, which has helped it to reach 149 downloads to date. Being a top result for "score pad" helps a lot…
Tonight I watched a very special edition of Jurassic Park! The oldmurderhouse show was unforgettable. The actors were dynamic and exaggerated their roles. The props were campy. The sound effects were immersive. And they reenacted the whole damn movie, scene for scene. Plus some penis jokes.…
Until recently, Android developers had to choose between lousy options when writing their apps: Use APIs from the latest OS release. Don't support earlier releases. Support earlier releases. Don't use APIs from the latest OS release. Use reflection and conditional code to use the latest APIs while also supporting earlier…
I'm a proud new member of Square's engineering team. The company's Android apps are among the best on the platform. I'm hoping to make them even better.…
Unsurprisingly, it turns out that ActionBarSherlock is amazing. I was able to get Rounds running on Gingerbread in just a couple hours thanks to this brilliant library. I'm impressed by how faithful the adaptation is. My app looks and behaves the same on all Androids! Instead of coping with version…
Mike Loukides has a thoughtful overview of the Oracle America vs. Google trial outcome and its consequences. My favorite bit: "An API copyright is tantamount to copyrighting all possible implementations of that API, not just the implementation created by the copyright owner. That's clearly unacceptable. Copyright is not about…
It's been a full year since Shush was featured on Android Market. Installs have been pretty flat since then, and I'm hoping to fix that. Tonight's update adds a 'Share' button that lets you G+/facebook/tweet/email a link to the app's download page on Google Play. It's an…
Brian Nenninger created an open source project called image-playground that lets you code your own image filters on-the-fly, right on your Android. It takes the camera image, applies your code, and shows you the result live. The code below shows my own pixelation + grayscale filter. Butters was kind enough to…
Craig Andrews has a GitHub project that makes Android 4.0's HttpResponseCache work on earlier Android releases and the JVM. The project also includes the latest and most stable HttpURLConnection.…
Someone recently sent me a link to an IBM slide deck on collections implementations. It has examples of the many ways Java programs can waste memory. It reminds me of why coding is difficult: Using abstraction is expensive. Even careful, appropriate abstractions slow down the application by adding load to…
I'm in the early stages of learning OpenGL ES for an Android app. The best resources I've found thus far are: Nico Weber's Google Body talk from Google I/O learnopengles.com Android's official OpenGL docs OpenGL's performance model is new to me. As I understand it, the GPU is…
I love to read daringfireball. John Gruber makes good arguments and backs them up with good evidence. But I'm occasionally frustrated by the way the stories are framed. Reactions to Gruber is the blog I've been searching for: it provides counterarguments for those of us who don't share Gruber's point…
I learned quite a bit from Erik Burke's technical talk on Android UIs. My favourite is his trick to use a one-frame animation to fake setAlpha().…
The Android Ice Cream Sandwich code came out today. One of the new files I'm proud of is DiskLruCache, which serves as the backing store for the new HTTP response cache. This class isn't in the public API, but you need a disk-based LRU cache, this might be a good…
This audiobook is 20 hours of science, history, treatment and personal stories. Some of it is sad, some of it is technical and some of it is optimistic. I think I'm a better person for having listened to this book.…
Back in July my wife Jodie and I drove a U-Haul 4200km from Mountain View, California to our new home in Waterloo, Ontario. While in the passenger seat I pulled out my laptop and wrote some code to scratch an itch. The itch was that Gson's databinding worked in two…
There's a JVM option -XX:+AggressiveOpts that supposedly makes your JVM faster. Lots of people turn this on in Eclipse to try to make it faster. But it makes your JVM less correct. Today I found it to be the cause of a longstanding bug in dx. http://code.google.…
This 8 minute technical interview with Bob Lee taught me something new about references.…
Tonight I flashed MIUI on my Nexus S. There's some nice themes, though they remind me a bit of WinAmp skins from 1999. Their EsPink theme is the perfect home for Shush.…
MIUI is a careful, fluid Android mod that's gaining popularity with Android hobbyists. Unfortunately, it has a misguided feature that breaks Shush! Ringer Restorer. Follow these steps to disable that feature and fix Shush: Go to the Settings app. Select the Programs tab. Select the Call Settings option. Toggle Third…
Little Big Details is easy reading for UI nerds. Today's post shows Trello's clever sign-up success page: it uses you email address to provide a direct link to your inbox.…
I'm usually reluctant to try new programming languages but I'm excited about Dart. I've never written a line of code in Scala, Clojure, Groovy or Fantom. They're all trying to get me to switch from Java. But Java is comfortable. I'm productive despite its verbose syntax and extravagant class library.…
My tiny Android app is on the first screen of "shush" search results. http://www.google.ca/search?q=shush I'm getting the itch to write another app. Shush was Jodie's idea; she'll be my muse for app #2. My own app ideas are generally terrible! For example,…
First hack of my road trip from Mountain View to Waterloo is MiniGson. It's a stream-binding prototype that we're going to fold into GSON to make it even faster... MiniGson miniGson = new MiniGson.Builder().build(); TypeAdapter<Truck> truckAdapter = miniGson.getAdapter(Truck.class); System.out.println(truckAdapter.toJson(myUhaulTruck)…
I started coding up an Android version of my favorite 2-player card game, Schotten-Totten. I got as far as asking the game's inventor what he'd charge me for rights to release it free and open source. Unfortunately, they'd already given exclusive license to another electronic publisher. This made me sad…
Shush was recently featured on the Android Market. Overall the added exposure was fantastic. It took me almost two years to reach 10,000 installs but just two weeks to hit 150,000: Shush installs were flat until March 12, 2011 I make my email address available on the Shush!…
Today I participated in GuiceCon, a small get together of Guice developers and users. Here's a quick disorganized rundown of some observations and reactions... Too much rope. Guice's circular-dependency proxies and just-in-time bindings save developers from boilerplate. But these features have complexity costs. Almost everyone agreed that the benefit wasn't…
Occasionally you'll need to interact with text files that have a leading byte-order mark. This signals which charset should be used for converting bytes to characters. Unfortunately, the standard library doesn't include any facility to do this automatically. Instead, cut & paste this code to convert any raw InputStream into…
I've been doing a lot of GWT work, and I find the Development Mode to be particularly productive. Unfortunately I frequently seem to lose the "?gwt.codesvr=127.0.0.1:9997" URL suffix that makes dev mode work. My buddy Jeremy came up with a simple fix:…
I've been exercising Caliper, our new JUnit-like microbenchmarking framework. I'm using it to explore and to confirm my assumptions about the JVM and its libraries. At what size is LinkedList faster than ArrayList for queue-like access? What I want to measure is first-in-first-out: add elements at the end, and remove…
Using an operating system, programming language, or API for the first time is frustrating. Things don't work the way you'd expect! But stick with it long enough and you grow familiar. Rough edges seem smoother because you're aware of them. Jack Shedd was frustrated with Android for the first time.…
I just posted the first major update to Shush! Ringer Restorer. I was unhappy with how the first release used a ListView to pick a duration. The scrollable control wanted fewer options, but users wanted more options. My goal was to make Shush feel fast & simple, but scrolling interfered.…
Today we open sourced Vogar. It starts out as a simple little tool: you give it a .java file, and it runs it: **$ cat Foo.java ** package foo; public class Foo { public static void main(String[] args) { System.out.println("potato"); } }`</pre><pre class="…
One gap in the JSON spec is its coverage of numeric types. Aside from forbidding NaN and infinity, the RFC doesn't limits the range or precision of numeric values: The representation of numbers is similar to that used in most programming languages. A number contains an integer component that may…
Cute little search ads bring customers to sellers. Hooray for Google!…
It's cute, although I admit there isn't much utility in it: public class Hello { public static void main(String... args) { System.out.println("yippee!"); } }…
Challenge: can you write code that invokes foo()? class Impossible { public Impossible() { throw new AssertionError("you cannot instantiate me"); } public void foo() { System.out.println("The impossible is possible!"); } } The solution is in the comments...…
Laurence Gonsalves prefers compile-time code generation over runtime reflection. He writes, I think all-in-one toolchains (eg: IDEs) are actually part of the reason Java has both not enough magic (like Rob says) and also the wrong kind of magic (runtime reflection). If there was a standard way to plug code…
Java's type system isn't expressive enough to model everything exactly. But it's expressive enough to be productive! Our type-unsafety-is-okay precedent is Collection.clear(), JJB's infamous optional method. Type safety advocates see @throws UnsupportedOperationException and claim that it's damning of either the collections framework or the type system. But I claim…
I'm about a year late for project coin. But I still want an obvious Java language feature: !instanceof. To illustrate: public void equals(Object other) { if (other !instanceof Foo) { return false; } return ((Foo) other).bar.equals(bar); } With the instanceof operator, null instanceof T is false for all values of…
Out of the box, Windows computers work with whichever accessories you buy for them. If you get an MP3 player, it doesn't matter who sells it. Walkman, Zune and Sandisk devices all sync with Windows Media Player. But Macs can't do this. Connect a GoGear to a MacBook and you'll…
I've been working on bringing Android's DOM implementation up to version 3. This process has exposed me to some ugly code. For your entertainment, here are the worst bits: DocumentBuilder.parse() doesn't accept references to unparsed entities. But you can build such a DOM programatically. The API doesn't specify whether…
Java's Integer class includes two methods for converting values into Strings. There's a general one: /** * Converts the specified integer into a string * representation based on the specified radix. */ public static String toString(int i, int radix) { ... } Plus there's also methods for commonly used bases: /** * Converts the specified integer into its…
In working through some bugs in Harmony, one thing that's been consistent is my surprise. Floating point's special values slightly complicate things... Negative Zero Floats and doubles have two distinct representations for nada: 0.0F and -0.0F. NaN Rather than risking an ArithmeticException, floats model error values natively. There…
John Gruber praises the iPhone's lack of upgradeable storage: I simply don’t understand why Motorola doesn’t follow Apple’s lead and provide ample built-in storage rather than relying on removable SD cards. He overlooks an obvious benefit of having SD cards for storage: they're cheaper! Compare what it…
Suppose you've got a string that contains a floating point number: "3.5" or "2.5E-3". Your goal is to get a float from that number. There are a few different techniques to try... If you're familiar with parseDouble(), you could use that and then cast:…
I absolutely love IntelliJ IDEA; it's my favourite application. This tool makes programming in Java fun. It's my gateway to the zone, that magical hypnotic place where I disappear into the code for hours at a time. I write better code because I use IntelliJ, and I enjoy my job…
I just uploaded a new Android app, Shush! Ringer Restorer: When you turn your ringer off for a movie, this app turns it back on afterwards. It's activated when you silence your ringer using the volume buttons. You don't need to remember a special app! Once your ringer is off,…
Joe Clark, author of a fantastic book on Canadian English and a childish rant about Google employees is at it again. This time he's planning a book about how copyright benefits creative people: Who’s sticking up for the individual creator? Neither side is. The maximalist side wants to collect…