https://kotlinlang.org logo
Title
a

Akbar

08/26/2019, 7:37 AM
Hi guys do we have any standard naming conventions for android applications like ids,res names etc?
:google: 3
:stackoverflow: 2
a

Amirul Zin

08/26/2019, 7:41 AM
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

Akbar

08/26/2019, 7:45 AM
yeah thank you @Amirul Zin but one doubt for resource value names how shall we name them
is this good link for it ?
a

Amirul Zin

08/26/2019, 7:49 AM
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

Akbar

08/26/2019, 7:50 AM
yeah that's great solution
and for colors file do we have any naming convention ?
a

Amirul Zin

08/26/2019, 8:02 AM
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

Akbar

08/26/2019, 8:09 AM
Thanks a lot will check this out