Android JUnit results in Hudson

A little while ago I wanted my unit test results for my Android apps that I build with Hudson. I tweeted about it, but forgot to follow up with some more details, so here it is.

Since I the default android testrunner does not output it’s format in a xml suitable for Hudson, I decided to dig around and after looking at source for InstrumentationTestRunner I came up with this.

The com.neenbedankt.android.test.InstrumentationTestRunner extends the Android one so that an xml of the test results is written to the device when running the tests. To use this in your Hudson build you only have to take these simple steps:

  1. Add the testrunner to your project, and reference it in you AndroidManifest.xml (see here)
  2. Startup an emulator in your Hudson build using the android emulator plugin and launch adb to run the tests
  3. Pull the generated xml report file from the device and put it somewhere in your build dir so that Hudson can find it.

If all goes well, Hudson will pick up the results and use that to show the JUnit results.

For my own little projects it seems to work fine, although it I’ve implemented the bare minimum to get something working in Hudson.

Rainy Days 1.9

Yet another update for Rainy Days, my weather radar application for Android! This update has a few new features and bugfixes.
First of all some display flickering that occured on the HTC Desire is now fixed. This also fixes any flickering you may have when running Froyo. I’ve also updated the app for Froyo (Android 2.2) so that you can choose to install the app on the sdcard.

For devices like the Nexus, Droid and HTC Desire I updated the menu icons so that they are of better quality. I also updated the application icon to make it more according to the Android icon design guidelines (judge for yourself if it worked out :))

Under settings there is now an option to access a few experimental features. One is smoothing of the animation that uses a fade effect. I got some mixed reactions on this from users so I decided to make it “experimental” and disable it by default. Let me know what you think! The other experimental setting disables the filtering of the radar images, which gets you more detail when you zoom in. The last option in the experimental section shows the status of the fallback mode that is in Rainy Days a few releases already, to help me diagnose problems more easily.

In the settings dialog you’ll also find an option to make a small donation by buying Rainy Days Donation. Donating is optional, Rainy Days is not cripled in any way if you don’t donate, I’m not forcing anything on you :)
As always there are many bugs fixed!

More screenshots are in my previous posts about Rainy Days.
You can download Rainy Days by scanning the barcode below, or by searching the Market for “Rainy Days”.

Rainy Days barcode

Rainy Days 1.7 released

Update: I’ve released 1.8 to fix a force close issue when loading the European overlay.

Another update to Rainy Days, my weather radar application for Android! This version features a few new options and fixes.

First of all, it is now possible to change the opacity of the clouds using the on-screen slider, for example if you like to see the map better. This is a per session setting, which means that the normal opacity is restored the next time you start the app.

There’s also a new option to show your location on top of the radar images if you like.

Another change is that Rainy Days is now scaling properly on high dpi devices like the Droid and the Nexus and on lower dpi devices such as the HTC Tatoo. Short summary: it should now look a little bit better :) Also, on high dpi devices the image quality for Scandinavia and the US will be slightly better, reducing blur that was in the previous versions. Rainy Days will automatically select the higher quality images if your device supports it.

I hope you like this new version! Also if you like other areas to be added, let me know!

More screenshots here

You can download Rainy Days from the market using the barcode below or my searching for Rainy Days.
Rainy Days barcode

How to render an Android view to a bitmap

Yesterday I was wondering how to render a view to a bitmap.
It turns out to be pretty easy, you can use the View.buildDrawingCache() and related methods for that. The only gotcha I ran in to that you’ll have to layout the view yourself if you are instantiating the view outside of an activity.

Here is my working code:


Button b = new Button(context);
b.setText("Hello World");
b.setDrawingCacheEnabled(true);
// this is the important line :)
// Without it the button will have a dimension of 0,0
// and the bitmap will be null
b.layout(0, 0, 100, 100);
b.buildDrawingCache();
Bitmap bitmap = Bitmap.createBitmap(b.getDrawingCache());
b.setDrawingCacheEnabled(false);

App Engine overview presentation

Yesterday I gave a presentation on Google App Engine for a small group of people at Capgemini. I talked about my experiences so far and highlighted the main features of App Engine. I’ve published the slides on Google Docs, maybe it helps you to start with App Engine.

Rainy Days 1.6

Another small fix, this time for Rainy Days. On certain devices such as the HTC Legend the display showed heavy flickering when “show my location” was enabled. Since I enabled this by default in 1.5, I figured that it was a good idea to fix this, so I replaced the standard MyLocationOverlay with my own.

Other than that, no new stuff :) Let me know if you like to have an area added to Rainy Days!

Small Engine Watch update

I’ve published a small update for Engine Watch that fixes login problems that some of you are experiencing. Big thanks to Alvin Wang for testing this on his Droid!

Market barcode and more details are in this post

Rainy Days 1.5: Hawaii + Spain + small changes

I’ve released an update to Rainy Days, my Android application, now at version 1.5. Compared to the previous version this version adds some more coverage for Hawaii and Spain.

Besides some bugfixes I changed the top bar to indicate the progress of the animation, added some warnings if you have disabled network location, and made “show my location” enabled by default as some people didn’t see it in the settings screen.
To answer the question that I get asked most (“what do the colours mean”) I’ve included a description of the colors for the various regions in the help, to take care of that :)

For more screenshots see my post for the 1.4 version which also includes a demo video.

You can download Rainy Days from the market using the barcode below or my searching for Rainy Days.

Rainy Days barcode

Rainy Days force close errors

I’m getting some reports of Rainy Days force closing on start up. Usually this is related to custom roms which are missing some classes. On loading the Google Maps component, Rainy Days throws an error, causing the Force Close error.

From the above I hope that it is clear that this not a situation that I can fix as it is an issue with the ROM. See this thread on Android developers for more info: http://groups.google.com/group/android-developers/browse_thread/thread/9781d2…

If you think you are seeing a different issue, let me know.

Building Android apps with Hudson

I’ve written a little blogpost on building Android applications with Hudson over at the continuous blog. Go check it out here!