Multitasking Mobile Metagenomics

Triple M?! You betcha! Up until about five minutes ago, I was under the impression that when somebody navigated away from Mobile Metagenomics, I had to drop everything. I envisioned stopping my download thread, saving current results, saving iteration values, saving a mode variable, and whatever else was necessary to later restart whatever MM was doing. I even wrote pseudocode for it yesterday, and spent the first half of today implementing it.

I’m glad I decided to take a short break and read about Android stuff, because as it turns out I was flat out wrong about onStop(). Apparently, I can actually let my worker thread busily download new chunks of data into MM while a user is checking their email, making phone calls, IMing their friends about how cool Edwardslab is… And if the phone needs additional memory and has to kill the MM process, I believe I can actually store & create aforementioned variables at that point. Which is cool not only because we get to save our progress, but also because I don’t have to crumple up two pages of pseudocode Laughing

I was starting to feel like MM might be getting close to finished (unless Rob and I do some kind of cool file browser-esque navigation of results, in which case I’ll probably have to spend a week just learning the Biology), but now I have a new thing for my brain to chew on for a bit. I feel like doing the annotation downloads as a background process adds quite a bit of value to MM as an application. The user may choose to view the results as they happen (which is the original intent of Real-Time Metagenomics to begin with), but they will no longer be locked into MM. Even as a developer I hate the notion of “okay I started MM, now lets have it sit there for 3 minutes”, so I can only imagine how much users would’ve disliked that.

As far as progress since my last post about what I’m actually working on, I’ve got a fair amount of error detection/recovery implemented in both Genome Search and Mobile Metagenomics. I’m not going to say that I can detect and recover from everything (because I’m sure we’ll find some obscure way to break the app), but it is looking pretty solid from my tests. Through normal use, it shouldn’t do anything weird anymore. Note that ‘normal use’ still confines us to being locked inside of MM unless we want to lose all progress. That is, until I get this next part figured out!