Locating Android native resources

Hello Android funs,

Yesterday I started looking for the default contact photo used in Android Contacts list, to use it in a contacts list that I am creating. Although, I already knew that many of Android resources can be referenced through the android.R package, I couldn’t find the image that I was looking for. After googleing, I found a page hosting all the drawables from the Android SDK 2.2 (http://androiddrawableexplorer.appspot.com/), another with drawables from the 1.5 SDK version (http://www.darshancomputing.com/android/1.5-drawables.html) and a nice app for developers that shows the list of drawables from the android.R package of the Android version it is running on(http://mgmblog.com/2008/12/12/listing-androids-drawable-resources/). All these references can prove very useful, cause using native images will make our apps look a bit more native, making the experience of the end-user better possible.

After all, when I opened the Android SDK location on my local disk, I noticed there is a subdirectory platforms/android-x/data/res/ where all the Android native drawables, colors, animations, layouts etc. are located. There is one such directory for each Android SDK version, located in the ANDROID_HOME/platforms/android-x/ directories. Through this list of drawables should find any drawable that you might be looking for. The problem is that not all of them can be publicly referenced through the android.R.drawable class (for unknown reason to me). So, if trying to access an image via the android.R.drawable does not give access to an image that you can locate inside the ANDROID_HOME/platforms/android-x/data/res/ directory, the last resort would be to copy that image to the application resources! I don’t know if there is another way, so if somebody does, please share your knowledge!


About sermojohn

Professional Software Engineer
This entry was posted in Android and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s