Jeff: October 2008 Archives

SearchDial 2.0

| | Comments (13) | TrackBacks (0)

I finally finished SD 2.0 and submitted it to the AppStore on 10/12.  I suppose it will be another few weeks before this gets cleared.

sd-search.jpgHere are some of the top issues users wrote to me about:
  1. Slow start times, or crashes, for large numbers of contacts (>1,000)
  2. Search by intials (Johh Doe is jd, dj, jdo, djo, etc)
  3. Allow a white background with standard blue controls
  4. Search through special characters: typing e is the same as é or è, etc.
  5. Do more than just dial - allow SMS, Email, Edit, etc as well
  6. Erase all AutoFavorites at once, or disable them altogether.
  7. Search the Notes field
  8. Enter letters through a standard phone keypad (2=abc, 3=def, and so on)
  9. When returning from a phone call, default to the last set of search results.
For 2.0, I tackled 1-6 (well, part of 5). 
This required a near complete rewrite focusing on fast start times for large numbers of contacts.  Rather than read the AddressBook into memory as 1.x did, I store a cached copy of the necessary fields in a local SQLite database.  This has the advantage of no overhead during application startup - 2.0 starts in the same amount of time with 10 contacts as with 10,000.  This also provides a lot of search flexibility, allowing more than the Address Book API calls support. It will also be easier to expand downstream by adding additional fields such as Notes.  The only real downside is that you have to manually sync SD with your Contacts.  This only has to be done when you change your contacts (and want to search the changed ones), NOT every time you run SD.  It's speedy up until a few thousand contacts and then starts to slow down.  At about 2,000 it will take 15 seconds.  At 10,000 as long as a minute.  Above 10,000 is unsupported, and will frequenly crash due to memory constraints.  It was a tradeoff I had to make based on the assumption that 95% or more folks have less than 10K contacts.  Comment here if you fall into the > 10K category.

I also made some big changes to the UI.  I have always been hesitant to use a toolbar or tabbar in order to maximize the vertical space, and therefore the number of contacts displayed while searching.  However, even more important is the notion of "one click action": find your number and tap it - no intermediary screens.  To resolve this, I implemented an "Action Mode" toolbar:toolbar-small.jpg
 
This works by letting you choose which mode you are in.  If you want to SMS someone, hit the SMS toolbar button, search and then select your contact.  You can also switch modes after searching.  SMS Mode will only display Mobile numbers, and Email Mode will only display email addresses.  You can specify the default mode on startup.  This lets you still get the benefits of "Start, Search, Connect" and the flexibility of other actions, and allows you to optimize the number of clicks for your common use case.

All 3 modes support the DirectDial concept in that if your search result is not found, you can finish typing the number or email address and connect accordingly.  I had also intended to include Edit in this release, but it was going to be a bit more time consuming than I first thought (at least to do it right), so its been pushed until a future release.

I included a few new settings (you get to settings through the main iPhone Settings screen).
sd-settings.jpgFrom here you can choose a white background, turn off AutoFavorites, choose your default Action Mode, and set the colors as before, including email.

I also multi-threaded the search to allow you to keep typing while it searches in the background, and if you type fast enough and have enough contacts it will even attempt to cancel your previous searches in favor of your lastest one.  If you have 10,000 contacts you may see this in action; if you have < 500 you will never be able to tell.  Also if you have < 100 contacts it syncs with your address book so fast I don't bother displaying  the progress screen, so here is a good look :)
sd-sync.jpg
As always, comments and feedback welcome.  I really do appreciate the constructive emails, and very much appreciate those who volunteered to test my various betas.  I'd hate to do another 1.0 fiasco, so I am grateful.