1. Unless you work for Google, use the library method for your current language.

2. It's Java boilerplate, and you don't.