Where are all the standard Android icon resources?

I have just started writing my first ever Java/Android application, so forgive the total n00b question.

How do you access the the standard operating system icons such as search icon/menu icon etc? They are not in the res/drawable folder where I would expect to find them. Are they available as part of the SDK or must you download them seperately?

EDIT

Maybe you can help me further - I am getting the following error (repeated on):

[2011-09-08 19:59:47 - TweetTab] C:\Users\Dan\workspace\TweetTab\res\menu\options_menu.xml:4: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_menu_search').

However, the icon is not empty, the xml looks like this:

<?xml version="1.0" encoding="utf-8"?>

<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/search"
        android:icon="@drawable/ic_menu_search"
        android:title="@string/search"/>
</menu>

Am I missing something?

SOLVED

I changed android:icon="@drawable/ic_menu_search" to android:icon="@android:drawable/ic_menu_search" and it could then find the icon.


Solution 1:

You can acces them via android.R.drawable.* or in xml by @android:drawable/something.

Solution 2:

I installed the Android SDK for Eclipse on Windows.

Now I can find all ressources under "C:\Program Files\Android\android-sdk-windows\platforms\android-9\data\res..."

Solution 3:

try this instead:

         android:src="@android:drawable/ic_menu_camera"

Solution 4:

it is now possible to use vector assets to generate standard (or customised) icons for android.

  • Add 'com.android.tools.build:gradle:1.4.0-beta3' to your build.gradle file. (The stable version will be out in the coming weeks).
  • Add a vector asset by right-clicking res/drawable/ > New > Vector Asset. Android Studio provides a built-in viewer for you to pick your drawable.
  • Reference your icon like you usually do. Eg: android:icon="@drawable/ic_help_24dp"