3

Even though the standard name conversion for XML seems to be like "myName" and not "my_name" or "my-name", XML files in Android use "my_name" name conversion (android:title="@string/action_settings")

Therefore, I wonder, do I have just to be down with that, is that a standard name conversion Android uses?

Ahmad Kayyali
  • 8,233
  • 13
  • 49
  • 83
Alan Coromano
  • 24,958
  • 53
  • 135
  • 205

1 Answers1

4

You can use camelCase but underscore_style makes things more consistent.

Many resource identifiers in R are derived from file names in res and the file names can only contain [a-z0-9._] so e.g. upper case is not allowed. R.id identifiers are special as they are not derived from file names. Still it makes sense to make them follow the same naming rules as the file-based resource identifiers.

laalto
  • 150,114
  • 66
  • 286
  • 303