Removed unused lines.
Disabled vibration if application is visible.
Added activity for settings. Also made some cleanup.