I’ve had a few minor breakthroughs on the Käppler code I wrote about yesterday. I now have a Droid-Fu / MM test application with a working function mode, including pretty progress dialogs and bars that actually behave correctly! (Those who were in the lab during the week that I spent getting those to work the first time know how much this success means to me…) I’ve begun migrating the new code I developed into the actual Mobile Metagenomics project and I’m having to make some adjustments.
The most drastic change I’m currently considering is abolishing the two-activity model that MM currently employs. What I mean by that is: MM currently has two major phases (actually Android activities) called MobileMetagenomics and ResultView. The first activity is the one where the user is presented with menu options to choose the type of annotation that they’d like to perform. The second is where the user goes as soon as they click the “upload” button; they are shown progress dialogs etc and eventually their results. This is all good, sensible, and very object-orientated.
Unfortunately, due to the nature of the application and the concurrency that I’m trying to implement, the two-activity model is proving problematic. My single-activity test case doesn’t have a ‘menu’ sort of activity loaded up in front of the results; consequently, it behaves just fine if I hit the home key and relaunch it a bunch of times while it does work for me. On the other hand, two-activity MobileMetagenomics is currently choking on the handoff between MobileMetagenomics and ResultView. There probably exists some clever way of making them get along, but I’m not sure it is worth the time investment to find this method.
The other solution that I’m considering involves hiding (or destroying, or something) pieces of the UI based on what the user is doing and making visible other parts of the UI as needed. ResultView already has some UI elements hiding that are only displayed when a graph is requested, so that part shouldn’t be an issue. What concerns me about this approach is how to handle the user doing one annotation and wanting to go back to the menu. Currently MM handles this just fine – the back button kills whatever work they were doing and returns from ResultView to MobileMetagenomics.
I’ve definitely got some thinking to do before I figure out the proper course of action. The good news is that the code to actually do the uploads asynchronously works. I just need to figure out how to slot that code into MM properly.