Tag Archives: GenomeSearch

Adding Error Recovery to GS / MM

One of the tasks that I’ve been meaning to work on for some time is doing some actual error recovery for MM. I realized however, that not only is this a pretty big problem to get a hold of, I also never did it for GenomeSearch. Since we want to put both on the market someday anyhow, I figured I may as well start with the more simple app and get some practice.

I took Daniel’s network status checking snippet, stripped out the textview stuff specific to his test app, and turned it into a small boolean method for GS to query. Now, when the app launches, it checks for network availability before it tries to fill up the list of Genomes. If it should fail, I have an alert dialog method which either recurses on itself until the network is available, or closes the program. The user is able to click ‘Retry’ or ‘Quit’ to achieve either option. In the future I may want to add an arbitrary delay between re-tries, or we may choose to just leave it with no delay.

I also put into place a little bit of code to let the user know if something goes wrong anywhere along the GenomeSearch process. This part isn’t quite done yet; I had most of the code in place last week, but due to some complexities I didn’t anticipate I had to not use any of the cool Toast error pop-ups. (Specifically, the methods I put the Toasts into are called from both the UI thread and a worker thread. The worker thread isn’t allowed to perform the toast pop-ups, and I had forgotten that we were using a worker thread in GS, so I have to work around this a bit.)

I have the solution to the Toast issue about 75% in-place, but I need to do a couple more things and then test it before I call it good to go and move on to MM. I had honestly been dreading the error recovery stuff, but once I traced through GS, it was actually very easy. Not only that, but I made some passing improvements to the code as I went along! MM is a bit more work to trace, but I already did a preliminary run-through, so I should be able to tackle this in the coming week 🙂

GenomeSearch Video Online!

I created a demonstration video of the GenomeSearch application. This video is taken in the Android Emulator running on my desktop, so the mouse cursor in this video simulates my touch input on a real phone. The GenomeSearch application is definitely still unfinished, and is not perfect, but we feel good enough now about what it does do, that we feel comfortable releasing the .apk and the demonstration video. (See my previous post for .apk link!)

Watch the video here

GenomeSearch Demo Online!

I’ve uploaded a sneak peek of GenomeSearch in case anybody would like a look at the work we’re doing. To install it, first download it here, or use the QR code behind the read more cut (not working just yet, there are some issues with the .apk not being signed or something which prevent direct-to-phone installs), then follow the instructions here.What worked for me were the steps in the “How to Non-Market .Apk Application on Google Android G1 Phone” section. I connected my Ion to the Ubuntu PC I use in the lab via USB, typed adb install GenomeSearch.apk in a terminal window (from the correct directory), and it “just worked”. Note that I already have the SDK installed on this machine, had enabled applications from unknown sources, and that my Ion did not automatically mount itself as a USB storage device. Your mileage may vary on how much of that you already took care of for yourself!

A few words of warning for this version, beceause it is very alpha; if your internet connection is bad/nonexistant when you first launch the app, you will get a JSONParse error and the app won’t work (ever… I think). This is obviously a major cause for concern and a top priority for us at the moment. Assuming you have a decent connection and perform a valid search, there isn’t anything else that we know that will break the app. By all means though, when you find one, shoot Daniel or myself an email!

 

Continue reading

GenomeSearch v1 (Kind of…)

Today I successfully ran what I would call something like an alpha v1 of GenomeSearch. It works on a real Android phone, connects to the internet, loads genome data, performs the search, launches the web browser app when you click links, etc. I haven’t created a program package for it to run stand-alone yet (i.e. without being initially installed and launched by Eclipse on a PC that the Android is USB-connected to), but this is a possibility in the near future.

Two things that Daniel and I want to change with the current version of the app are the lack of a prompt above the box where a user is supposed to enter a genome (as this is very confusing to those who didn’t actually write the app), and the fact that the onscreen keyboard doesn’t minimize when the user performs a search (which blocks search results). At present, the user can hit the ‘back’ button to minimize the onscreen keyboard and free up more screen real-estate for results, but this is obviously not desirable. Clearly, the back button is calling some method to minimize the keyboard when the user presses it, and once we figure out what that method is, we can fix this UI clunkiness.

GenomeSearch Update

So far today I’ve made the actual search function itself work, added hyperlinks to the search results, and added a scrollbar for results which take more room than is available. Additionally, the work for the search now happens in a second thread, so it doesn’t lag the User Interface and generate ANR (Application Not Responding) events. So instead of the UI seeming like it hangs when the user presses the search button, a progress dialog is displayed instead!

One notable performance issue with the application is that the AutoCompleteTextView currently available from google is a little slow, and tries to perform matching too early. I looked around the web and others have grumbled on blogs about this issue, but until Google improves this part of the API, I don’t think there is a fix.

Weekend update!

I spent some time this weekend working on GenomeSearch and doing things to my EEEPC, so I could round out my hours for the week (stupid jury duty…).

GenomeSearch update: I tweaked some methods a little bit, and coded the actual search behavior of the app. It isn’t working just right quite yet, but I’ve narrowed down where the problem is. It seems like after I build my hash of the results, I’m not pulling the data out of it correctly. This is likely what I’ll work on tomorrow.

As for the EEEPC, I like the look of the EEEbuntu that Nick gave me. I’m hoping it’ll run my development environment better, because the WinXP was really sluggish on the Android emulator. I managed to delete my taskbar on my last install, so I’m setting up a fresh install now. I’ll write another post sometime with some EEEPC/EEEbuntu gotchas, incase anybody else wants to do this install!

Summer Research Plans

Today I spent the first half of my day working on the GenomeSearch Android app, and the second half of the day tieing up loose ends with my old bbhFinder perl script.

I still need to verify the correctness of the last bit of bbhFinder at some point, but beyond that I’ve coded everything I set out to. I’m thinking of shifting my focus to the Android development for the summer, as I’ve been working on bbhFinder for over a full semester at this point. The Android development is also looking very promising at the moment, and satisfies the cell phone grant!

I thought I would make a few notes for either myself or anyone who works on bbhFinder (or related projects) in the future. Here are a few areas where I think the project could be improved:

As it stands, bbhFinder has several features, and a number of output files. These are currently all performed every time the script is run, which would likely lead to more work being done than a user cares about in a given sitting. This could be done better if bbhFinder asked the user which features they would like performed.

To achieve this, a simple GUI could be implemented which would have checkboxes for each feature, and a ‘Run’ button to perform all options checked. Further, the code could be broken up and organized a bit better, such that the main method is simply if(option1IsChecked){perform method 1} and so on. This would also increase readability of the code, which never hurts!

As for GenomeSearch, I finally got the spinner working today, and it shows every genome that the drop-down box in the opensocial app does!

Restructured GenomeSearch Android app

Today (while I sat waiting to be called at jury duty for 7 hours…) I worked on restructuring the GenomeSearch program. It had become a bit of a cluttered mess since I originally made the class as a test class for putting pieces of tutorials together.

Now the program is laid out a lot more logically and in better OOP style. It took a fair bit of work, but I think that having a more sensible groundwork will keep our future work organized. I also worked a bit on getting the spinner to display the genomes from the seed, but this work is not complete just yet. I feel like what I’m uploading is pretty close to what Daniel and I need, however!