Saturday, February 6, 2010

Claustrum Lite Didn't work on 1.6 QVGA?

And getting bad reviews because of it too. Today Claustrum Lite recieved a 1 star rating with a comment, "Doesn't work on tattoo" I have gotten a similar comment about the Droid which I knew wasn't true since I develop on a Droid, but I wanted to check this one out. The HTC Tattoo runs Android 1.6 on a QVGA phone. I build an emulator to match the Tattoo, and "New Game" crashed my app.

It turned out that I wasn't even using the code that was causing the crash. So it was an easy solution to remove that code that made a bitmap that wasn't even being drawn any more. Another thing that fixed the problem was to include the bitmap in the "drawable-ldpi-v4" resource directory. I had been relying on this file to exist in the "drawable" resource directory, and for most cases that seems to work. For me it was breaking in 1.6 if I called Bitmap.extractAlpha() in my Application's onCreate on a bitmap that I just tried to load from resource that was in the "drawable" directory. The bitmap loads, at least eventually, because removing the extractAlpha() call solves the problem, but putting the bitmap in the "drawable-ldpi-v4" resource directory also runs successfully.

I also tested a 1.6 HVGA but did not have the same problem. It took me a while to configure a 2.0.1 QVGA emulator, but when I did, the "bad" code worked there too. So it looks like it was isolated to 1.6 QVGA devices. I know 1.6 is still about half of the android market, but don't know how many of those are QVGA.

Perhaps the problem is calling extractAlpha() on an auto-scalled resource, or maybe decoding the resource doesn't complete before I was calling extractAlpha() on the following line, if the resource isn't in the most direct resource directory.

I thought I was covering all bases testing with 1.5 and 2.0.1, but that isn't true. I wasn't testing all resolutions/densities. But even if I was I still would have missed the problem because it appears to only exist in one desnity on one OS version. Time to up the testing procedure, but at least I got all of my emulators built now.

I hope this cuts back on some negative reviews. I haven't really fixed the header info(score, level, lives, etc.) yet, but not crashing is more important than looking perfect for tonight. I am going to publish the fix tonight, along with everything else I have been working on, most excitingly, border enemies!

No comments:

Post a Comment