Simplify interface of Google examples and fix the name and comment of userName variable

Yes, the examples have been successfully tested against 1.8.0.