1 page.title=Resource Types 2 parent.title=Application Resources 3 parent.link=index.html 4 @jd:body 5 6 <div id="qv-wrapper"> 7 <div id="qv"> 8 <h2>See also</h2> 9 <ol> 10 <li><a href="providing-resources.html">Providing Resources</a></li> 11 <li><a href="accessing-resources.html">Accessing Resources</a></li> 12 </ol> 13 </div> 14 </div> 15 16 <p>Each of the documents in this section describe the usage, format and syntax for a certain type 17 of application resource that you can provide in your resources directory ({@code res/}).</p> 18 19 <p>Here's a brief summary of each resource type:</p> 20 21 <div class="sidebox-wrapper"> 22 <div class="sidebox"> 23 <h2>{@code R.id} Is Not a Resource</h2> 24 25 <p>You will often use an {@code R.id} integer to handle {@link android.view.View} objects in 26 your UI. Although the {@code id} is a subclass of the {@code R} class, it is not considered a 27 "resource" because it is not a reference to an externalized application resource. The {@code id} 28 is simply a unique identifier that allows you to handle elements in your UI by instantiating 29 objects with {@link android.app.Activity#findViewById(int) findViewById()}.</p> 30 31 <p>For information about using {@code R.id} with your UI, see <a 32 href="{@docRoot}guide/topics/ui/declaring-layout.html#attributes">Declaring Layout</a>.</p> 33 34 </div> 35 </div> 36 37 38 <dl> 39 <dt><a href="{@docRoot}guide/topics/resources/animation-resource.html">Animation Resources</a></dt> 40 <dd>Define pre-determined animations.<br/> 41 Tween animations are saved in {@code res/anim/} and accessed from the {@code R.anim} class.<br/> 42 Frame animations are saved in {@code res/drawable/} and accessed from the {@code R.drawable} class.</dd> 43 <dt><a href="{@docRoot}guide/topics/resources/color-list-resource.html">Color State List Resource</a></dt> 44 <dd>Define a color resources that changes based on the View state.<br/> 45 Saved in {@code res/color/} and accessed from the {@code R.color} class.</dd> 46 <dt><a href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a></dt> 47 <dd>Define various graphics with bitmaps or XML.<br/> 48 Saved in {@code res/drawable/} and accessed from the {@code R.drawable} class.</dd> 49 <dt><a href="{@docRoot}guide/topics/resources/layout-resource.html">Layout Resource</a></dt> 50 <dd>Define the layout for your application UI.<br/> 51 Saved in {@code res/layout/} and accessed from the {@code R.layout} class.</dd> 52 <dt><a href="{@docRoot}guide/topics/resources/menu-resource.html">Menu Resource</a></dt> 53 <dd>Define the contents of your application menus.<br/> 54 Saved in {@code res/menu/} and accessed from the {@code R.menu} class.</dd> 55 <dt><a href="{@docRoot}guide/topics/resources/string-resource.html">String Resources</a></dt> 56 <dd>Define strings, string arrays, and plurals (and include string formatting and styling).<br/> 57 Saved in {@code res/values/} and accessed from the {@code R.string}, {@code R.array}, 58 and {@code R.plurals} classes.</dd> 59 <dt><a href="{@docRoot}guide/topics/resources/style-resource.html">Style Resource</a></dt> 60 <dd>Define the look and format for UI elements.<br/> 61 Saved in {@code res/values/} and accessed from the {@code R.style} class.</dd> 62 <dt><a href="{@docRoot}guide/topics/resources/more-resources.html">More Resource Types</a></dt> 63 <dd>Define values such as booleans, integers, dimensions, colors, and other arrays.<br/> 64 Saved in {@code res/values/} but each accessed from unique {@code R} sub-classes (such as {@code 65 R.bool}, {@code R.integer}, {@code R.dimen}, etc.).</dd> 66 </dl> 67 68 69 70 71 72 73 74 75 76 77