5

I am new in Android programming, and I saw there is a "m" before objects, like:

mCursor

mAdpter

mView


So what is this "m"? Should I use it in my code?

Sorry for this poor question...

User
  • 295
  • 1
  • 2
  • 15
  • 1
    Have a look at this question: http://stackoverflow.com/questions/2092098/why-most-of-android-tutorials-variables-start-with-m – Bono Sep 26 '14 at 23:41

1 Answers1

7

Follow Field Naming Conventions

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

You can see the document on those rules here.

Peter Pei Guo
  • 7,536
  • 17
  • 32
  • 51