Started in Chapter 23 of the Big Nerd Ranch Guide to Android Programming