I\'m looking to make my code more readable as well as use tooling like IDE code inspection and/or static code analysis (FindBugs and Sonar) to avoid NullPointerExceptions.
For Android projects you should use android.support.annotation.NonNull
and android.support.annotation.Nullable
. These and other helpful Android-specific annotations are available in the Support Library.
From http://tools.android.com/tech-docs/support-annotations:
The support library itself has also been annotated with these annotations, so as a user of the support library, Android Studio will already check your code and flag potential problems based on these annotations.