the sample code from coursera android course