24

There are Coding Conventions for Android. They include some stuff like naming conventions that can be checked using checkstyle.

I've found some config for checkstyle: http://ksoichiro.blogspot.com/2011/05/android-checkstyle.html

But I want to ask if there is some more complete config for checkstyle. Maybe Google provide some official checkstyle config?

2

5 Answers 5

21

Here you can find some that implement http://source.android.com/source/code-style.html although none of them is official.

3
  • 2
    A version for the current Checkstyle version 5.6 can be found at: gist.github.com/shareme/4197561
    – Bernd
    Aug 9, 2013 at 8:29
  • Do these work for Android studio. If so till what version? Dec 19, 2016 at 18:29
  • @VishnooRath you must add apropriate gradle task to ruch checkstyle
    – pixel
    Dec 19, 2016 at 18:33
8

There is Android Check plugin (https://github.com/noveogroup/android-check).

It has two predefined Checkstyle configurations you can use:

1
  • I am pretty new to this. Could you please explain how can i import these settings to my Android studio? I have tried importing to the Inspections section in Android studio common settings. I have QA plug - PMD, Checkstyle and Findbugs installed.
    – Ajith M A
    Mar 5, 2017 at 14:28
6

Here is the checkstyle configuration used for Picasso by Square folks: https://github.com/square/picasso/blob/master/checkstyle.xml

Here is Google's Java Style Checkstyle Coverage: http://checkstyle.sourceforge.net/google_style.html

4

CheckStyle for Android:

  • CheckStyle.
  • PMD.
  • Findbugs.

To add a dependency to gradle: Gradle Plugin for Android

More info on the Blog

0

Here you are:

http://source.android.com/source/code-style.html

I have also gone through their source (GrepCode is good) to look at their styling. You could create a custom Eclipse formatter based on these rules.

EDIT

Very sorry did not see your link above. I am unaware of anything like this. Sorry I could not be of more help.

1
  • I provided this link in question text, so I know about this coding style description. I am interested in Checkstyle tool config. Mar 3, 2012 at 6:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.