Added build.gradle so this project can be added as a library. Removed `<application>` declaration in manifest.

  * Changed `switch` for `R.id.**` to `if-else` cause those won't work if
    this is added as a library.