Android venting

I became so incredibly frustrated with Android last night that I had to vent somewhere. Sorry for all of you who have heard this before.

With the hiptop, it seemed that there was some considerable effort expended in asking “what is annoying about using devices on a flaky cellular network?” The OS and applications incorporated all kinds of wonderful features, from aggressive buffering and queuing to a standard “this hasn’t been sent” indication (italics) to the “your web page is done” notification—it all worked well and was a source of enjoyment and delight even when the network was broken.

With Android, this doesn’t happen. Not at all. Standard Android applications (particularly Market) do an astonishingly atrocious job of handling network drops, download failure, etc. A modal dialog telling you “THE SERVER IS DOWN” is completely useless and user-hostile. Operations that seem like they should not require a network connection (like seeing the list of installed applications) load in multiple undefined stages that make you wonder if something broke. Asynchrony seems to be in all the wrong places.

A very obvious example of the difference is the data connection icon. As maligned as it was thanks to T-Mobile network failures, the 3-dot connection icon on the hiptop was wonderful; it was clear to both technical (for whom the dots had actual meaning) and nontechnical users that the process of connecting to a cellular data network had several stages, and that it was quite possible to have a data connection without an operable Internet connection over it.

Oh look, Google Voice just failed to download. The notification says “Download unsuccessful.” So helpful. When I tap on that notification, it lets me stare at a “Loading…” spinner for 30 seconds before I get “Attention: A network error has occurred. Retry, or cancel and return to the previous screen.” I’ve got 3G data with 4 bars.

The words that came out of my mouth at this point are not fit for posting on this blog.

Pester 1.1b8 released

Get it.

Pester 1.1 has been a long time coming. It’s been my own personal battle with the second-system effect. 1.1b8 is a big step towards finishing, though.

-rw-r--r--  1 nriley  users  295049 Oct 14  2002 Pester-1.0.dmg
-rw-r--r--  1 nriley  users  428727 Jan  7  2003 Pester-1.1b2.dmg
-rw-r--r--  1 nriley  users  524911 Apr  9  2003 Pester-1.1b4.dmg
-rw-r--r--  1 nriley  users  749389 Nov 25  2007 Pester-1.1b5.dmg
-rw-r--r--  1 nriley  users  746933 Nov 27  2007 Pester-1.1b6.dmg
-rw-r--r--  1 nriley  users  756428 Nov 28  2007 Pester-1.1b7.dmg
-rw-r--r--  1 nriley  users  881197 Mar 25 23:34 Pester-1.1b8.dmg

The list of new features and bug fixes since 1.1b7 is substantial. Among them:

  • Customizable alert sounds—the most requested feature. It uses QuickTime, so you’re welcome to pick a movie or even a bitmap or PDF to use as well. I’ve used the latter to display stretching exercises on a regular basis, for example.
  • Selectable sound output device and volume for alert sounds. If you have your headphones and speakers accessible as separate output devices, as I do (e.g. if you have a Mac Pro or an external audio device), it’s useful to have the alert sound audible when you’re away from your desk. Change the output device from Preferences. (Note: Pester doesn’t yet respond to audio devices being connected/disconnected while it is running, although you should always get audio output somewhere.)
  • Baseline, ICU-based support for non-natural language dates and times is much more robust (for example, simply “20” or “8p” works to specify 8:00 PM).
  • Support natural-language dates in non-English languages via Date::Manip. I uncovered some bugs here, which the author of Date::Manip is working on fixing, but Catalan, Danish, Dutch, French, German, Polish and Russian should work fine. The date popup is limited to the days of the week, but that’s easily remedied (see below).
  • Optionally wait until you stop typing or moving the mouse to display a message. This is quite helpful so you don’t start typing into the Snooze box when you want to be typing into another document. The feature is disabled by default; enable it in Preferences.
  • Handle time zone changes, many more time zones, and more reliably determine the time zone.
  • Autocomplete common natural-language dates—my favorite new feature.
  • Simplify tab order. I previously tried to do something very complex with the tab order, which confused Cocoa and could cause you to get “stuck” in some area of the window.
  • Better save and restore focus when you’re working as an alarm goes off; will no longer bring unwanted windows to the front.
  • Open the Set Alarm window in the current Space when triggered with a keyboard equivalent or the Dock menu.
  • Switch to tomorrow automatically if necessary when tabbing into “on”. This is a feature I first implemented in Pester for hiptop, which I’m actually happier with than desktop Pester (see the aforementioned second-system effect). The upshot of this is that if you specify a time that’s already passed, while the specified date is today, simply tabbing into the date field will switch the date to tomorrow. It’s easier to use than to describe, really!
  • Allow intervals up to 999 weeks.
  • Display “today” and “tomorrow” in the bottom left corner of the Set Alarm window in case you can’t remember what day it is.

Note that the natural language date’s language is determined by the date format, as specified in System Preferences → Language & Text → Formats.

If you speak Catalan, Danish, Dutch, French, German, Italian, Polish, Portuguese, Romanian, Russian, Spanish, Swedish or Turkish, it’d help if you could translate the date popup contents:

/* Date popup */
"today" = "today";
"tomorrow" = "tomorrow";
"in 2 days" = "in 2 days";
"next «day»" = "next «day»";
"next week" = "next week";
"in 2 weeks" = "in 2 weeks";
"next month" = "next month";
"in 2 months" = "in 2 months";
"in 1 year" = "in 1 year";

Feel free to put the results in a comment or email them to me (pester at sabi.net).

If you’ve got any bug reports, comments or feature requests, please let me know. If you’re looking for things to test, read the release notes in the Read Me (Help menu) which summarize the changes since 1.0.

For now, the main thing that needs finishing for 1.1 is documentation (help wanted!). The latest source is on GitHub.

Enjoy!

NCIDpop 0.9.16 released

NCIDpop is a client for the NCID (Network Caller ID) server. See previous posts for more information on my work with NCIDpop.

New in this version:

  • Optional Growl notification support.
  • Formats phone numbers using Address Book preferences.
  • Skip leading 0s for Address Book lookup (useful outside the US/Canada).
  • Fixed saving of reverse lookup URL when you click the “Set” button (was broken due to this Cocoa misfeature).
  • Made networking code significantly more robust. One side effect: you should see much less log spam when the NCID server is unavailable, because the connection process is now interruptible.

There’s now an active Windows maintainer and with the source code moved all the way from CVS to Mercurial, collboration should be significantly easier in future. The settings trigger is a bit tricky so I do plan on providing an easier alternative in a later version; that said, I’ve also got another 4–5 open source projects clamoring for my attention.

Android thoughts, part 2

I was going to write a longer Android post, but really, just go read this. Android might be a bit more tolerable if I hadn’t actually used better handheld devices, in the form of the hiptop, iPod touch/iPhone, early Palm OS and the Newton.

If you really do want to read what I was going to write, here are my notes. (Everything up to “Six months later:” refers to my experience with the G1 in July; afterward, with the Nexus One.)

Android thoughts

The rather anticlimactic conclusion to my mobile phone dilemma in June was the G1. I didn’t like it at the time and still don’t; however, the writing was on the wall for the hiptop, finally drained of life by Microsoft, and it was the only viable choice for smartphone-with-keyboard at the time. (Have you tried typing on a Palm Pre?)

Since I started using the G1, it’s received one minor OS update (1.5→1.6) and a few truly useful apps (Google Voice and Google Maps Navigation). The phone is still slow and unwieldy, with such poor battery life that I must carry multiple batteries and sometimes a charger around with me.

Today Google introduced their new phone, the Nexus One, running Android 2.1. It’s not bad, but I doubt I’ll be buying one.

The Nexus One fixes the biggest problems with the G1: speed, storage, battery life and the lack of a real headphone jack. It adds a decent design and beautiful screen. For me, however, it also removes a major reason to use Android over the iPhone: a physical keyboard with a decent layout. I’m able to work around the awful Android Gmail app by using Mutt in a SSH client; I couldn’t do that on the Nexus One. (Soft keyboards are fine for typing text, not so much for interacting with a Unix system.)

The largest remaining problem with Android is the navigational UI. It:

  1. hides most options behind the context-sensitive Menu button
  2. fails to adequately expose hierarchy and the behavior of the Back button
  3. fails to adequately expose multiple running applications (“activities”)

The first two aren’t issues with the iPhone UI, and the last has been adequately addressed by webOS’s card model. It still surprises me, for a company whose Web applications are known for speed and efficiency, that the Android UI came out so badly.

Applications that try to innovate with UI on Android, of which the two that stick out most in my mind are the otherwise-terrific Locale and the Android 2.1 Gallery, tend to confuse more than they help. For example, Gallery uses a double-tap on the Menu button for multiple selection, then arbitrarily checks the bottom center photo to start. If you uncheck the photo as (not surprisingly) you may not want to do anything with it, Gallery exits multiple selection mode; instead, you have to check another photo before unchecking the bottom center one. In Gallery, the presence of a single selection is necessary to maintain multiple-selection mode; the iPhone’s ubiquitous “Edit” toggle button doesn’t have this problem.

So after six months, my situation is much the same: wait for a future Android device or a future iPhone. I doubt Palm is going to produce a device with the capabilities I want any time soon. Palm’s application ecosystem is much smaller than even Android, so it’s right out.

(I have a much longer Android post in preparation…if the above doesn’t make sense in places, let me know so I can clarify.)

NCIDpop 0.9.15 released

Last year I worked on NCIDpop, a network caller ID client originally written by Alexei Kosut. I recently spent a day or so doing some further hacking on NCIDpop to fix problems I and others had noticed. My changes have now been incorporated in an official release.

What’s new:

  • Address Book reverse lookup support: NCIDpop will display the caller’s name, phone number label (e.g., “mobile”) and picture instead of the caller ID if the information is available in the Mac OS X address book. Also, when you double-click a caller entry in the call log, it’ll open the corresponding Address Book card rather than doing a reverse lookup.
  • Don’t reformat non-numeric 10-digit numbers (e.g., turning Vonage’s click2call into (cli) ck2-call).
  • A few small memory leak fixes, thanks to the Clang Static Analyzer.
  • Updated reverse lookup URL list (some providers had consolidated or changed their URL format).
  • Bug fix: handle NCID servers specified by IP address instead of hostname.
  • Bug fix: properly reconnect to the NCID server on wireless network changes (SCNetworkReachability behavior is…interesting, and I had only tested 0.9.14 with wired networks).

Once again, if you’re wondering “why use NCID when I already have caller ID?” If you have SIP service (e.g., Vonage) at home, NCID/NCIDpop gives you caller ID on the first ring on every computer display in the place, which can save a lot of unnecessary running around to try to find the phone.

Of course, it’s just in time for me to consider giving up phone service at home as I’ll be spending much less time there in the fall. I’m overdue for a new mobile phone, but I can’t decide between an iPhone 3G S, the Palm Pre or perhaps waiting for a future Android device. I haven’t played with the Palm Pre yet; that’s on my schedule for next week.

Also: Jython 2.5 (final) was released today! It’s been a long while coming. We’ve still got a lot of work to do, particularly on performance and Java integration.

Maintaining Kerberos and AFS credentials in Screen

If you use a persistent screen session on a machine running OpenAFS, you’ve likely experienced long delays and confusion when your tickets and tokens expire.

The Screen and Kerberos patches will create a credentials cache for your screen session and automatically renew tickets. That’s a start, but your tokens still expire.

A relatively simple modification simply runs aklog after renewing your tickets. The patch for this is here; Debian packages for acm-screen, incorporating Kerberos and AFS patches, are here.

However, this still leaves a problem when your tickets exceed their renewable lifetime. For that, I wrote a zsh function which wraps screen and re-kinit/aklogs if there is less than a day remaining before they expire for good.

screen() {
  # note: this breaks if you have >1 screen session
  cc=(/tmp/krb5cc_scr_$(id -u)_*(N[1]))
  [[ -n $cc ]] && (( ${#@} )) && {
    local princ=$(klist -5 $cc | awk '/Default principal:/ { print $3 }')
    [[ -n $princ ]] && {
      local expiry
      zmodload zsh/datetime
      strftime -r -s expiry '%D %X' \
        "$(klist -5 $cc | awk '/krbtgt/ { getline ; print $3 " " $4 ; exit }')"
      (( expiry - EPOCHSECONDS < 86400 )) && {
        kinit -r7d -c $cc $princ && screen -X screen aklog || return 1
      }
    }
  }
  =screen $@
}

Enjoy.

ICeCoffEE 1.5b5 released

ICeCoffEE 1.5b5 is out. The only remaining known bug I plan to fix before 1.5 final relates to disabling localized services.

This version includes bug fixes and compatibility updates (particularly for Safari 4 Beta), as well as no longer doing anything if you ⌘-click outside text on a Web page in WebKit/Safari.

Fonts and NX

For several years, I’ve been using a combination of Screen and NX as a detachable research environment. Since I started working on Jython and using Mercurial, I’ve been able to do more work on the Mac locally (especially with Eclipse, which isn’t fun in NX) then easily sync up to our Linux research machines when necessary for timing runs, or to use Pin or Simics. So while my need for NX has been reduced, I still need it several times a week.

I’ve very much had a love-hate relationship with NX. It works so much better than the alternatives such as VNC, RDP or using TRAMP with Emacs. But NX is also flaky and fragile, with bugs like insisting on a specific ordering of bit depths. NX forks OpenSSH and various X components, then fails to keep up to date with recent changes in each. Coordination between the various components is haphazard at best. The Mac NX client front end is still a PowerPC app compiled against an ancient version of Qt.

It’s hard to diagnose problems when NX fails by refusing to resume, losing, or worst of all, destroying your session. A multitude of log files exist—for the client, look in ~/.nx/temp—but require you distinguish expected brokenness from unexpected brokenness, only possible if you have a working setup to compare against.

Fonts are a particular sticking point. The NX developers really want client-side fonts to go away, but both of the X clients I tend to run in NX (rxvt and Emacs) use client-side fonts, so I don’t really have a choice. Some points to be aware of:

  • If an X client is using a font and it isn’t available to the local X server (NX client machine) when you try to resume a session, in the best case you’ll get a font like fixed substituted or see a bunch of boxes in place of your characters. In the worst case the session will be destroyed. Be careful.

  • The documentation claims you must have the same set of fonts accessible on both the (NX) client and server, in order for them to be accessible and usable. Don’t forget to run mkfontdir—on OS X, this sometimes runs for you. However, sometimes a font can appear in xlsfonts because it used to be accessible; in this case it’ll either display a scaled bitmap or a substituted font.

  • At least on the Mac, there’s no guarantee that a font which appears in xlsfonts locally is actually available to NX. I don’t quite understand what’s going on here, but if you put your font in one of the default font directories (what’s displayed when you run xset fp default; xset q), run mkfontdir and xset fp rehash if necessary, then attach your NX session, it’s likely to work. On one of my Macs and user accounts, I can get it to work for custom font directories too, but I have no idea how to reproduce this.

The other major NX annoyance I run into is clients that either don’t start when they’re supposed to, or whose windows never appear when the session resumes. In the former case, sometimes the initial client I ask NX to run (a small rxvt) never starts, but the NX session is up, so I can start another rxvt if I notice before NX destroys the session from a lack of clients. In the latter case, the clients are there, so for example I can use emacsclient -e ‘(new-frame)’ then C-x 5 1 to rescue my Emacs session and close all the unavailable frames. I haven’t found a more general fix for this one.

Random bonus for anyone who doesn’t follow my Twitter stream: ggplot2 is an amazingly well done plotting package. Having spent quality time with Jgraph, PyChart, matplotlib, Mathematica, Excel, Numbers, etc. I’ve never found one that did what I wanted as quickly. Highly recommended.

Restoring a hard drive from Time Machine

After replacing the drive in my iMac, next came a restoration from backup. Once again, this is covered pretty well elsewhere on the Web, but I’ve got a few comments about the process. Sorry about the lousy image quality; it’s late and I was too tired to mess with my camera.

I’ve got two backups on my drive; one of my iMac and one of my MacBook Pro. The restore utility identifies them both, but not in a particularly understandable fashion. Why does the MacBook Pro backup get a Time Machine icon and the iMac backup a FireWire disk icon? Why does the MacBook Pro’s machine name appear but not the iMac’s?

DSC_0713.jpg

Once I selected the first disk, for some reason it defaulted to showing me an ancient backup I didn’t even know I had, rather than the most recent backup available (why?)

DSC_0715.jpg

I never reinstalled Mac OS X, just renamed the disk after upgrading the iMac from TIger to Leopard, but that seems to be enough to throw off Time Machine.

DSC_0716.jpg

Ah yes, the day the hard drive died while I was far away in New York.

DSC_0717.jpg

The restore utility took quite a while to “calculate space required to restore data”. I’m not sure why it bothered—the backup drive is actually smaller than the new destination drive, and in any case, when calculation is complete, it doesn’t even display the results and proceeds to erase the destination disk.

DSC_0720.jpg

The time remaining indicator was wildly incorrect: after initially climbing over 8 hours, it didn’t take more than a couple of hours to perform the restore.

DSC_0723.jpg

Once the restore was complete and I rebooted into OS X, nearly everything was fine. The usual culprits (Mail caches, Spotlight, MobileMe syncing) were understandable, but I lost a few odd things like my input method configuration (Spell Catcher came up though I had it disabled) and Spaces keyboard shortcuts (not even the defaults were selected; I had no way of navigating Spaces until I reset them).

Next Page »