Hi guys do we have any standard naming conventions...
# android
a
Hi guys do we have any standard naming conventions for android applications like ids,res names etc?
google 3
stackoverflow 2
a
So far, it’s
snake_case
for file names and resource value references. For View ids,
camelCase
is much more useful if you use DataBinding generation as it is easier to search.
a
yeah thank you @Amirul Zin but one doubt for resource value names how shall we name them
is this good link for it ?
a
Good enough. Depending on the complexity, I sometimes prefer to prefix the feature name first so all of my resources are grouped together and much more visible at first glance.
a
yeah that's great solution
and for colors file do we have any naming convention ?
a
Should be
snake_case
for file names. Color ids is normally
snake_case
as well but its much more lenient since some prefer
camelCase
One thing to note is that you can split to multiple color value files e.g.
colors.xml
,
shadows.xml
,
materials.xml
as you can easily transfer those auxiliary colors between projects.
a
Thanks a lot will check this out