68 posts Posts by hugo

Countdown for SmartWatch

A while back the friendly folks over at Sony sent me a SmartWatch to play with. It’s a nice little gadget and I’ve created an app for it called Countdown

Countdown is a countdown timer that you control on your watch. When the time is up, the watch wakes up and vibrates for you to take action on whatever you’re counting down to.

Get it from the Play store and let me know what you think of it!

Rainy Days 2.3 released!

It has been a while since I’ve updated Rainy Days, but I think this update is a nice one ;)

In 2.3 I’ve added a few new features:

  • Sharing: you can now share the image you see in the app when you pause the animation
  • Updated layout for tablets and Android 4.0 devices
  • Hardware acceleration on devices that support it
  • New coverage: Alaska, Canada and Iceland. There’s even a composite showing US and Canada at the same time!
  • Futher tweaks and changes to make the app even faster

I’m very excited about the sharing option; now you can share the image to with your loved ones on Facebook, twitter, email! Just tap the screen once to pause, then select the share icon from the actionbar or use the menu to select the share option.

I mentioned the actionbar already. Rainy Days now fully supports the actionbar on Android 3.x and up. Previously it was already shown, but now the timestamp and the search, pause/play and share buttons are also shown in the actionbar. 

I hope you’ll enjoy this update. As always get it from the Google Play store.


Rainy Days eumetsat imagery currently offline

The imagery from the eumetsat source isn’t updating since yesterday 19:00 UTC, so unfortunately that means that Rainy Days currently is not displaying anything for the regions the eumetsat overlay covers. I hope this will be resolved soon, sorry for the inconvenience.

Update: Things are back to normal again! 

60 Android Hacks book review

Thanks to Manning and the Dutch Android User Group, I got the chance to review the book 60 Android Hacks by Carlos Sessa. This book is currently in Manning’s MEAP program, which means that it is not finished or edited, but you can already enjoy some of the chapters as the work progresses, which is great!

Like the title suspects, this book contains 60 useful hacks on various Android topics like layout, animation, views, but also tools and languages. I really like this format because these kinds of books are nice to use as a reference no matter if you are just starting Android development or if you are an experienced Android developer. Each chapter is organised describing a small problem, discussing the solution and then a brief summary of the solution. Awesome.

The word hacks in the title might sound like this book describes wierd cornercase kind of types of situations, but that’s not the case. It’s more like a recipe book which decribes how you can leverage Android mechanisms to create better apps, ranging from chapter 1 (pdf) which describes how to center a view using a LinearLayout’s weights to gems like chapter 17 (adding glowing effects to texts), which describes how to use a custom font and two TextViews to create a cool glowing digital clock.

Only a few chapters are available right now, but if you look at the list of chapters, this sure looks be a promising book with great to-the-point content, so go check it out here.

Be aware of ProGuard optimizations on Android apps

Yesterday I released Rainy Days to celebrate passing the 400k downloads. Soon after, my celebration was partycrashed when a few users reported that Rainy Days wouldn’t open on their phone. First I was clueless, especially because I either couldn’t reach those users or couldn’t get a logcat from them showing me the error. The only thing I had to debug was their Android OS version and screen size basically. So I fired up some emulators and tested various configuration again, this is something I do before every release in fact. I couldn’t reproduce the bug.

Then I got one other email. Again, a user on 1.5 which couldn’t launch the app. So this time I took the released apk, put it on the emulator, and sure enough: it crashed on open. Actually it crashed with a verify error, meaning that a class is referencing methods that don’t exist on that platform.

When it runs fine from Eclipse on 1.5, but the released version doesn’t it, what is the difference? The released version was run through Proguard to obfuscate the code. But Proguard does not only obfuscate, but also optimize your code and it does a pretty good job at it.

Unfortunately it had this time inlined the class I use for compatiblity code which caused the verify error. The code I took great care to separate out to make sure it wouldn’t be called on older platforms was now inlined in my main activity. Auch.

So the lessons learned are these: be aware of optimization and test the release apk on the emulator. Proguard is a powerful tool and with great power comes great responsibility :)

Rainy Days 2.2.3

Rainy Days just passed the 400.000 downloads mark, amazing! To celebrate, here’s a little update that improves performance and fixes some bugs.

New in this version is that you can move the map when the animation is paused. To do that use two fingers to pan the map. Because this uses multitouch it will not work on all phones and may not work that well on some other phones which have limited multitouch support.

If you already have the app installed, the market should notify you soon of an update. If you don’t have Rainy Days, check it out in the market!

Edit: 2.2.3 unfortunately broke 1.5 & 1.6 support, which is fixed now in 2.2.4.

Android Logging

Logging in any type of software is a useful tool to debug and improve your software. Typically you’ll have different types of stuff you want to log: errors, information, traceing etc. So most logging systems have a concept of levels that allow you to specify how important a message is, so that at a later time you can enable a certain type of logging to inspect.

In Android it is handled by the Log class. It too allows for runtime configuration of loggers and it involves setting Android system properties using the setprop command, which is nice if you are building an app as part of the OS but maybe overkill or even clunky if you just want to create your next great app. And what if you don’t want your shipping app to have any logging whatsoever? You certainly want it during development, trust me :) Well enter this little utility class:

package com.neenbedankt.rainydays.util;
public class Logging {
    public static final boolean LOGV = true;
    public static final boolean LOGD = false || LOGV;
    public static final boolean LOGI = false || LOGD;
    public static final boolean LOGW = false || LOGI;
    public static final boolean LOGE = false || LOGW;
What this does is setting some flags that indicate what level of logging you want. If you want all logging, just set LOGV to true. If you only want the “info” level and up just enable info. Easy! Now you still have to reference this from your code like this:

// you can also use a static import to drop the Logging part...
if (Logging.LOGD) {
 Log.d(TAG, 'This is my debug statement');

Tip: you can setup an Eclipse template to generate these kinds of code blocks very fast.

Now the beauty of this all is that since the LOGD variable is a static final (a constant) the compiler will strip out the entire if statement if the LOGD variable is false, hence no logging in your final app and no bytecode generated for it either.

So by introducing a simple class and wrapping the log statements in an if block you’ll still be able to enable particular levels of logging, while in your shipping product the logging is stripped out.


This night (in my timezone) something went seriously wrong with the server that I use for Rainy Days. The result was that “network error” was displayed. I’ve fixed this now and all should be returning to normal within a couple of hours.

If you still are experiencing network errors after that, please let me know.

Rainy Days 2.2.1

I just pushed out Rainy Days 2.2.1 that fixes some important bugs. On slow connections Rainy Days would sometimes crash or hang. I’ve now fixed this so get the new version!

More updates

I’ve just released Rainy Days 2.2, a small update to fix some crashes that are reported. Also not all of you liked the on-screen legenda, so it can now be switched off from the settings.

I also like to thank all of you who support Rainy Days by buying the upgrade or just telling me how much you like the app! Really amazing!