On another post there is a link on a nice tutorial on how to integrate PMD, lint, findbug and Checkstyle with gradle. This is great and works super nice with a CI. but... while programming you are not getting this advices... wouldn't be nice to have at least checkstyle with you during each compilation?
1) download this plugin https://github.com/jshiell/checkstyle-idea
2) This plugin only works with IntellJ/Android studio on JDK of 64 bits so we must change some settings.
/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/bin/javac -version is the 1.8 version if not... well download it from oracle :)
2.2) modify the Info.plist in
/Applications/Android Studio.app/Contents/Info.plist and search for the key
and change the value to
3) Install the plugin using the option Install plugin from disk
4) Go to settings -> others -> checkstyle add your styles or use the default one.
5) Add the checkstyle tab: View -> Tools windows -> Checkstyle