Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Almost all of our Java is written for android, so we're using the android platform development android studio config. You can also read more about the java style guide for android contributors here

You can import the provided AndroidStyle.xml file into Android Studio by:

1. Copy the AndroidStyle.xml file into ~/Library/Preferences/AndroidStudio/codestyles/
2. Restart Android Studio
3. Open Android Studio > preferences
4. Click the Code Style drop down and select Java
5. Choose the AndroidStyle option under the scheme drop down at the top.
6. Click apply, and OK

Rules

Comments

Use JavaDoc comments for classes, and every public method. For protected and private methods, use your own discression. Eg. if a protected method is going to be overridden a lot, write a JavaDoc comment!

Remove comments generated by Android Studio when class files are created. Typically it will append something like:

/**
 * Created by MikeKlemarewski 2014-12-22
 */

These are just noise. If you need to know who created the file, look at the Git history.

Member Variables

Do not prefix member variables with 'm'. Member variables should be declared at the top of the class if they are used often, otherwise they should be declared right before they are used.

Methods

Methods should be kept as shorts as possible. There is no hard limit. Methods should do one thing, and do it well. If a function starts to creep over 30 lines, this is a sign that it may have too many responsiblities and be broken up.