- Install the checkstyle plugin 'checkstyle idea'
(**Intellij**: File → Settings → Plugins → Install and restart)
- Configure it to use our custom checkstyle.xml
(**Intellij**: File → Settings → Tools → CheckStyle → '+' sign → Use a local Checkstyle file → tick the active checkbox)
**and** ( File → Settings → Editor → Code Style → ⚙️ icon → select the new code style)
- Go back to your editor main page elect, Select the 'Checkstyle' tab at the bottom, set rules to the checkstyle created.
- Install the Google Formatter plugin 'google-java-format'
(File → Settings → Plugins → Install and restart) 1. Set it from the settings
(File → Settings → google-java-format settings → Enable checkbox → set Code Style: Android Open Source Project (AOSP) style)
For Other IDEs install the JAR file and set the --aosp --skip-sorting-imports params from https://github.com/google/google-java-format