More Käppler Code

A few months back I wrote a few blog entries about some Android code written by Matthias Käppler, an Android developer from Germany. He has written several ‘helper’ classes for Android methods which he felt needed to be improved. While folks like myself and Käppler often complain about the features of certain Android methods, I want to make it clear that we actually really appreciate the fac that Android lets us write our own methods to replace theirs. The Android team has a lot on their plate, and if programmers like Käppler can help them along in certain areas, more power to them.

The real focus of my blog entry today is to talk about what is currently going on with MM. As I said in lab meeting recently, the realtime code broke and after a few days of trying, I still couldn’t figure out why. I was browsing Käppler’s page on his old concurrency code that I was using and I saw a little note informing me that he had better code to replace the old classes with. I made the executive decision to bite the bullet and learn a new way to write concurrent Android code.

Since then I’ve been struggling a bit with learning the new BetterAsyncTask, but I’m finally making some headway. I have a semi-working proof of concept, and I’ll probably comment on Käppler’s blog to get help with a few things I can’t figure out. Unfortunately he’s not been able to post any example code yet, so I’m left wandering through his code and javadoc to figure things out. So far, I have code that mimics the ‘Function mode’ annotations of MM, but doesn’t have any pretty dialogs or progress bars yet. Käppler says he’s made these things better, and I’m sure once I figure out how to use his code, I’ll have some sweet dialogs / bars.

Edit: I found a hidden gem of knowledge about the Android Manifest that should save a lot of headache in the future. I was having an issue where new instances of my application would be launched every time I clicked their launcher. My desired functionality was to resume the original instance which I’d moved away from by hitting the Home key. Apparently, this is not the default functionality. In order to get this functionality, one must add the following line to their activity tag in the android manifest: android:launchMode=”singleTask”