In the Android SDK, there is a comment that says it’s more efficient to retrieve resources by identifier instead of by name.
Is this the only reason it’s discouraged to use getIdentifier()?
I need to programmatically access one of several hundred resources and so far my design makes it easier to access raw resources by name instead of identifier.
Because comparing integers is much faster than comparing strings and I would guess that the resources are hashed by their ID, so if you get a resource by ID they can grab only a small subset of resources and perform a fast search. If you search by name they’d have to iterate through all the resources and do a slow string compare.