R.raw
like R.id
in basic words like pointer to where these values have been stored.
When you save some image or wav file under raw folder, after Project refresh you can call it like R.raw.arthaswhat5
that returns int
.
By the same way R.id
is generated when you add new GUI element.
There is no dependency between R.raw
and R.id
. R.raw
points to raw folder when R.id
points to your view XML.
from `View` you can fetch id to you it for `if` statement or `switch`
like
if (v.getId() == R.id.your_button){ /*...*/}
[Edit]
if you have > 100 songs I would use assets
folder instead raw
. Because in raw
all names must be lower-case and you can't create there sub-directories. Will be hard to handle and maintain.