I am newbie to Android and playing with some Hello World codes.I observed that android put every resource i.e. image,string etc in res folder and we access it like @drawable/icon i.e icon image in drawable folder or like R.layout.main which means main.xml inside layout folder.
But while accessing strings we use @string/string_name but we dont specify its parent folder name i.e.values.Why syntax differs for strings ?
It may sound silly but it makes to think and put this question.
All resources of the same type in android is in a flat hierarchy.
You don’t specify a directory name but instead the type of the resource.
Even if you split all strings between different files it will always be
@string/string_nameI’m afraid.A good thing you can do to get some structure is to do something similar to this: