Android Studio Code Optimization and Code Formatting

Various code optimizations, discovered by android studio's code analytics.

includes performance issues like concatting strings in stringbuilder's append method.

Also code got formatted and overall code readability improved, which should make it easier to maintain in future.