Android Testing

The Art of Agile Development, by James Shore and Shane Warden is an excellent book. I recently read it and found it inspiring. Whilst many of the practices don’t work for a lone developer, test driven development seems like it will.

So now I’m trying to set up unit testing for when I’m developing Android appications. However, I found the guidance on the Android developer website unclear. Having spent some time getting frustrated at my apparent inability to follow simple instructions I made it past the first step. I share that first step in the hope that I can help others.

The developer notes give examples using relative paths. I found that this didn’t work. Here is the relevant folder structure for my application, which is called Aoide.


The Testing Fundamentals page shows that I want to create a tests folder in the aoide folder. I found this command, run from the Android directory, worked for me:

tools/android create test-project -m ~/Android/aoide \
    -n AoideTest -p ~/Android/aoide/tests

Now to figure unit tests…

Gingerbread [part 2]

A follow up to my last past.

Don’t Bother!

If you have an HTC Desire and you’re considering installing the developer update then don’t bother. HTC still include lots of crap that you don’t want and hide/replace the Google goodness that you do want.

I have been asked about battery life. It might be a little better, I have no hard figures, but after a few weeks of general use I have to say that I am underwhelmed. WiFi notification is annoying, but probably a result of improvements to aid power conservation. I got to the point where I tried to root the phone so I could clear stuff off it. I can’t do this now as the software is too new.

I have also noticed that synchronisation fails when storage falls below the threshold; 15MB on the Desire. Is this and Gingerbread feature?


It would also be really good is developers made their applications installable to the SD card. None of the Twitter clients that I’ve tried (Tweetdeck, Seesmic, Twitter) will do this. Google+ won’t either, and at 8MB it’s pretty big. I know that there are limiting factors. Applications that run as a service, for example, must be installed on the phone. But I also believe that this is easy to work around, perhaps by spliting the application into two parts. (The Ebay application provides notifications but can be moved to the SD card.)


Upgraded my HTC Desire to Gingerbread today.

The upgrade was promised some time ago but then HTC said that there wasn’t enough memory. There was outcry and, after removing some of the Sense UI stuff they freed enough space. However, the update is “only intended for developers”. I read one blog saying that there might be issues with SMS and MMS messages. I did wonder if, post update, I had a Wi-Fi issue, but it seems okay after a power cycle.

The Update Process

This was annoying. I downloaded the zip file and unpacked it only to find that I needed a Windows PC. I run Fedora on both my desktop and my laptop. I borrowed my daughter’s laptop. Next, I had to install HTC Sync. This required Adobe AIR and three other components. (All were included in the HTC install file, no wonder it’s 55MB!) The update did run smoothly and quickly once it started. There were plenty of warnings too. Rightly so; all operator content, messages, contacts, settings got wiped. Like it says, backup before installing!


Not many!

If I’d known how little difference it would make I wouldn’t have bothered. I wanted the pretty new keyboard and more space. I’ve got a little more space, but the keyboard is still HTCs version and there are still many HTC applications that I don’t want and can’t delete. The Stocks tracker – not interested. And why does the HTC mail application take 3.95MB. I don’t use it, I use GMail and that takes 1.47MB. Are they the same?

The way that Wi-Fi works seems slightly more annoying. It tells me that a network is available, long enough for me to wonder if it will connect. It does connect, most of the time, I think. Perhaps the signal threshold has been changed.

Update: I’ve come to the conclusion that if the signal is weak then no attempt is made to connect, just notification given that a wireless network has been detected.

Power management is another improvement, but I’ll have to see how it goes for a while before I can tell if that is improved.