hlastras
hlastras

Reputation: 344

What means character 'm' in the name of attributes in android classes?

I'm starting on android, and I've found a convection that I don't know decipher their meaning.

For example:

private NavigationDrawerFragment mNavigationDrawerFragment;


private CharSequence mTitle;

I don't know the meaning of character 'm'. I supouse that is a convection of android, but i think that it meaning something.

my? myNavigationDrawerFragment? myTitle? I dont' know.

Thanks.

Upvotes: 0

Views: 1391

Answers (1)

Alex K
Alex K

Reputation: 8338

You can find the answer to this from the Android Code Style guide.

Follow 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.

You'll see it around everywhere. It's the convention. I've always thought of it as myObject, but it really doesn't matter. That's just the convention. Others think of it as "member" object.

Upvotes: 4

Related Questions