We have about 300 drawables/icons in our application and each drawable/
icon is associated with an Id meaningful within the functional context
of our app. These icons are to be displayed in a Gallery and when the
user makes a selection, the relevant "Id" for the selected icon needs
to be passed to the backend server.

Presently, inside getView of the Gallery Adapter, we are making use of
getResources().getIdentifier() to fetch appropriate icons since we
know only the names of the icons and their IDs. We DO NOT know their
resource ID.

The official documentation discourages use of this API. Also, though
we have not yet instrumented our code, people have said this API and
also reflection is inefficient.

Questions:
What are other alternatives that we can try?
How should such resources be bundled so that they can be addressed in
code efficiently?

Thanks.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to