Persistent contact list on orientation change
When you rotate your phone, Android needs to redraw the screen with all your widgets correctly aligned. The simplest way to do this is to trash your current view (activity) and draw a new one. This is exactly what Android does, and whilst it’s simple, it does mean that any transient data, such as a contact list, is lost. I’ve taken the opportunity to cache this data between screen redraws thus allowing the same data to be presented.
Background task for search
Whilst not a UI feature or a new search ‘feature’, it is an important update. If you have a large contacts database, lets say a company directory with 6,000+ contacts, then any search is going to take seconds, if not minutes especially with huge notes. The Android OS has a watchdog task that notices anything that’s working hard on the UI thread and kills it with an ‘Application Not Responding’ message. It’s not a problem I’ve noticed in testing, but someone has it as I can see a stack trace on the Google developer site.
The changes run the main search process on a background thread and Android provides some straightfoward classes to extend that to make running thread on Java even easier than it already was. One problem with running on a background thread is that the user can carry on pressing buttons. Again, Android provides a simple solution with a one-line call to pop a ‘please wait’ dialog complete with animated graphic. As noted above, rotation redraws the screen and there’s some code required to check if we’re running a thread and, if so, reshow the progress dialog on redraw.
Android OS anonymously reports any application failures to the offending author so that they can see and fix it. Unlike the iPhone equivalent, it doesn’t wait for the user to sync their data to their PC and, being Java, is easy to parse also unlike the iPhone symbolic debug faffing. It’s only on OS 2.2, unfortunately 😦