timmy00274672 / AndroidPractice

Example of Learning Android
4 stars 1 forks source link

Naming style #28

Open timmy00274672 opened 10 years ago

timmy00274672 commented 10 years ago

There are a number of good guidelines out there for writing Android code. Please try and follow these field naming conventions:

Non-public, non-static field names start with m.
Static field names start with s.
Other fields start with a lower case letter.
Public static final fields (constants) are ALL_CAPS_WITH_UNDERSCORES.

Example from API guide:


public class MyClass {
    public static final int SOME_CONSTANT = 42;
    public int publicField;
    private static MyClass sSingleton;
    int mPackagePrivate;
    private int mPrivate;
    protected int mProtected;
}