Android naming convention

ribot’s Android Guidelines are a good example of standard naming conventions:

Naming convention for XML files:

activity_<ACTIVITY NAME>.xml - for all activities
dialog_<DIALOG NAME>.xml - for all custom dialogs
row_<LIST_NAME>.xml - for custom row for listview
fragment_<FRAGMENT_NAME>.xml - for all fragments

Naming convention for component/widget in xml files:

All components for X activity must start with the activity name
all component should have prefix or short name like btn for Button
For example,name for login activity component should be like following.

activity_login_btn_login
activity_login_et_username
activity_login_et_password

Short name of major components:

Button - btn
EditText - et
TextView - tv
ProgressBar - pb
Checkbox - chk
RadioButton - rb
ToggleButton - tb
Spinner - spn
Menu - mnu
ListView - lv
GalleryView - gv
LinearLayout -ll
RelativeLayout - rl

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)