1 page.title= 2 parent.title= 3 parent.link=index.html 4 @jd:body 5 6 <div id="qv-wrapper"> 7 <div id="qv"> 8 <h2></h2> 9 <ul> 10 <li> {@code res/} </li> 11 <li></li> 12 <li> 13 </li> 14 </ul> 15 <h2></h2> 16 <ol> 17 <li><a href="#ResourceTypes"></a></li> 18 <li><a href="#AlternativeResources"></a> 19 <ol> 20 <li><a href="#QualifierRules"></a></li> 21 <li><a href="#AliasResources"></a></li> 22 </ol> 23 </li> 24 <li><a href="#Compatibility"></a></li> 25 <li><a href="#BestMatch">Android </a></li> 26 </ol> 27 28 <h2></h2> 29 <ol> 30 <li><a href="accessing-resources.html"></a></li> 31 <li><a href="available-resources.html"></a></li> 32 <li><a href="{@docRoot}guide/practices/screens_support.html"></a> 33 </li> 34 </ol> 35 </div> 36 </div> 37 38 <p> 39 40 Android 41 42 UI 43 </p> 44 45 <p> {@code R} 46 ID <a href="accessing-resources.html"></a> 47 48 Android 49 </p> 50 51 52 <h2 id="ResourceTypes"></h2> 53 54 <p> 55 {@code res/} </p> 56 57 <pre class="classic no-pretty-print"> 58 MyProject/ 59 src/ <span style="color:black"> 60 MyActivity.java </span> 61 res/ 62 drawable/ <span style="color:black"> 63 graphic.png </span> 64 layout/ <span style="color:black"> 65 main.xml 66 info.xml</span> 67 mipmap/ <span style="color:black"> 68 icon.png </span> 69 values/ <span style="color:black"> 70 strings.xml </span> 71 </pre> 72 73 <p>{@code res/} 74 {@code mipmap/} 75 1 76 </p> 77 78 <p class="note"><strong></strong> mipmap 79 <a href="{@docRoot}tools/projects/index.html#mipmap"></a></p> 80 81 <p class="table-caption" id="table1"><strong> 1. </strong> {@code res/} 82 </p> 83 84 <table> 85 <tr> 86 <th scope="col"></th> 87 <th scope="col"></th> 88 </tr> 89 90 <tr> 91 <td><code>animator/</code></td> 92 <td><a href="{@docRoot}guide/topics/graphics/prop-animation.html"></a> XML 93 </td> 94 </tr> 95 96 <tr> 97 <td><code>anim/</code></td> 98 <td><a href="{@docRoot}guide/topics/graphics/view-animation.html#tween-animation"></a> XML 99 100 {@code animator/} 101 </td> 102 </tr> 103 104 <tr> 105 <td><code>color/</code></td> 106 <td> XML <a href="color-list-resource.html"></a> 107 </td> 108 </tr> 109 110 <tr> 111 <td><code>drawable/</code></td> 112 113 <td><p>{@code .png}{@code .9.png}{@code .jpg}{@code .gif} Drawable 114 XML </p> 115 <ul> 116 <li></li> 117 <li></li> 118 <li></li> 119 <li></li> 120 <li> Drawable</li> 121 <li> Drawable</li> 122 </ul> 123 <p> <a href="drawable-resource.html">Drawable </a></p> 124 </td> 125 </tr> 126 127 <tr> 128 <td><code>mipmap/</code></td> 129 <td> Drawable {@code mipmap/} <a href="{@docRoot}tools/project/index.html#mipmap"></a> 130 131 </td> 132 </tr> 133 134 <tr> 135 <td><code>layout/</code></td> 136 <td> XML 137 <a href="layout-resource.html"></a></td> 138 </tr> 139 140 <tr> 141 <td><code>menu/</code></td> 142 <td> XML 143 <a href="menu-resource.html"></a></td> 144 </tr> 145 146 <tr> 147 <td><code>raw/</code></td> 148 <td><p> 149 {@link java.io.InputStream} ID {@code R.raw.<em>filename</em>} {@link android.content.res.Resources#openRawResource(int) 150 Resources.openRawResource()}</p> 151 <p> 152 {@code 153 assets/} {@code res/raw/}{@code assets/} ID {@link android.content.res.AssetManager} 154 </p></td> 155 </tr> 156 157 <tr> 158 <td><code>values/</code></td> 159 <td><p> XML </p> 160 <p> {@code res/} XML 161 162 XML 163 {@code values/} {@code <resources>} {@code <string>} 164 {@code R.string} {@code <color>} {@code R.color} 165 </p> 166 <p> XML 167 168 169 </p> 170 <ul> 171 <li>arrays.xml<a href="more-resources.html#TypedArray"></a></li> 172 <li>colors.xml<a href="more-resources.html#Color"></a></li> 173 <li>dimens.xml<a href="more-resources.html#Dimension"></a></li> 174 <li>strings.xml<a href="string-resource.html"></a> 175 </li> 176 <li>styles.xml<a href="style-resource.html"></a></li> 177 </ul> 178 <p><a href="string-resource.html"></a><a href="style-resource.html"></a><a href="more-resources.html"></a> 179 180 </p> 181 </td> 182 </tr> 183 184 <tr> 185 <td><code>xml/</code></td> 186 <td> {@link 187 android.content.res.Resources#getXml(int) Resources.getXML()} XML XML 188 <a href="{@docRoot}guide/topics/search/searchable-config.html"></a> 189 <!-- or preferences configuration. --></td> 190 </tr> 191 </table> 192 193 <p class="caution"><strong></strong> 194 {@code res/} </p> 195 196 <p><a href="available-resources.html"></a></p> 197 198 <p> 1 199 200 Android 201 202 203 204 205 206 </p> 207 208 209 <h2 id="AlternativeResources"></h2> 210 211 212 <div class="figure" style="width:429px"> 213 <img src="{@docRoot}images/resources/resource_devices_diagram2.png" height="167" alt="" /> 214 <p class="img-caption"> 215 <strong> 1. </strong></p> 216 </div> 217 218 <p> 219 Drawable 220 Android 221 222 </p> 223 224 <p></p> 225 <ol> 226 <li> {@code res/} {@code 227 <em><resources_name></em>-<em><config_qualifier></em>} 228 <ul> 229 <li><em>{@code <resources_name>}</em> 1 230 </li> 231 <li><em>{@code <qualifier>}</em> 2 232 </li> 233 </ul> 234 <p> <em>{@code <qualifier>}</em> 235 </p> 236 <p class="caution"><strong></strong> 237 2 238 </p> 239 </li> 240 <li> 241 </li> 242 </ol> 243 244 <p></p> 245 246 <pre class="classic no-pretty-print"> 247 res/ 248 drawable/ <span style="color:black"> 249 icon.png 250 background.png </span> 251 drawable-hdpi/ <span style="color:black"> 252 icon.png 253 background.png </span> 254 </pre> 255 256 <p>{@code hdpi} 257 Drawable 258 259 {@code icon.png} {@code 260 background.png} 261 ID Android 262 </p> 263 264 <p>Android 265 2 266 267 268 </p> 269 270 271 <p class="table-caption" id="table2"><strong> 2. </strong> 272 </p> 273 <table> 274 <tr> 275 <th></th> 276 <th></th> 277 <th></th> 278 </tr> 279 <tr id="MccQualifier"> 280 <td>MCC MNC</td> 281 <td><br/> 282 <code>mcc310</code><br/> 283 <code><nobr>mcc310-mnc004</nobr></code><br/> 284 <code>mcc208-mnc00</code><br/> 285 286 </td> 287 <td> 288 <p> (MCC) SIM 289 (MNC)<code>mcc310</code> <code>mcc310-mnc004</code> Verizon 290 <code>mcc208-mnc00</code> Orange 291 </p> 292 <p>GSM MCC MNC SIM 293 </p> 294 <p> 295 MCC/<em></em> 296 MCC 297 MNC </p> 298 <p> 299 {@link 300 android.content.res.Configuration#mcc} {@link 301 android.content.res.Configuration#mnc}</p> 302 </td> 303 </tr> 304 <tr id="LocaleQualifier"> 305 <td></td> 306 <td><br/> 307 <code>en</code><br/> 308 <code>fr</code><br/> 309 <code>en-rUS</code><br/> 310 <code>fr-rFR</code><br/> 311 <code>fr-rCA</code><br/> 312 313 </td> 314 <td><p> <a href="http://www.loc.gov/standards/iso639-2/php/code_list.php">ISO 315 639-1</a> 316 <a href="http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 317 3166-1-alpha-2</a> {@code r} 318 </p><p> 319 {@code r} 320 <em></em> 321 </p> 322 <p> 323 <a href="runtime-changes.html"></a> 324 </p> 325 <p><a href="localization.html"></a> 326 </p> 327 <p> {@link android.content.res.Configuration#locale} 328 </p> 329 </td> 330 </tr> 331 <tr id="LayoutDirectionQualifier"> 332 <td></td> 333 <td><code>ldrtl</code><br/> 334 <code>ldltr</code><br/> 335 </td> 336 <td><p>{@code ldrtl} {@code ldltr} 337 338 </p> 339 <p> 340 </p> 341 <p> 342 343 </p> 344 <pre class="classic no-pretty-print"> 345 res/ 346 layout/ <span style="color:black"> 347 main.xml </span>(Default layout) 348 layout-ar/ <span style="color:black"> 349 main.xml </span>(Specific layout for Arabic) 350 layout-ldrtl/ <span style="color:black"> 351 main.xml </span>(Any "right-to-left" language, except 352 for Arabic, because the "ar" language qualifier 353 has a higher precedence.) 354 </pre> 355 <p class="note"><strong></strong> <a href="{@docRoot}guide/topics/manifest/application-element.html#supportsrtl">{@code 356 supportsRtl}</a> 357 {@code "true"} <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> 17 </p> 358 <p><em>API 17 </em></p> 359 </td> 360 </tr> 361 <tr id="SmallestScreenWidthQualifier"> 362 <td>smallestWidth</td> 363 <td><code>sw<N>dp</code><br/><br/> 364 <br/> 365 <code>sw320dp</code><br/> 366 <code>sw600dp</code><br/> 367 <code>sw720dp</code><br/> 368 369 </td> 370 <td> 371 <p> 372 smallestWidth 373 374 UI 375 {@code <N>}dp</p> 376 <p> 377 600dp {@code 378 res/layout-sw600dp/} 379 600dp 380 600dp smallestWidth <strong> smallestWidth 381 </strong></p> 382 <p> smallestWidth UI 383 UI 384 smallestWidth 385 smallestWidth 386 387 UI<em></em></p> 388 <p></p> 389 <ul> 390 <li>320 391 <ul> 392 <li>240x320 ldpiQVGA </li> 393 <li>320x480 mdpi</li> 394 <li>480x800 hdpi</li> 395 </ul> 396 </li> 397 <li>480 480x800 mdpi /</li> 398 <li>600 600x1024 mdpi 7 </li> 399 <li>720 720x1280 mdpi 10 </li> 400 </ul> 401 <p> 402 smallestWidth 403 smallestWidth </p> 404 <p><em> API 13 </em></p> 405 <p> <a href="{@docRoot}guide/topics/manifest/supports-screens-element.html#requiresSmallest">{@code 406 android:requiresSmallestWidthDp}</a> {@link 407 android.content.res.Configuration#smallestScreenWidthDp} 408 smallestWidth 409 smallestWidth </p> 410 <p><a href="{@docRoot}guide/practices/screens_support.html"></a> 411 412 </p> 413 </td> 414 </tr> 415 <tr id="ScreenWidthQualifier"> 416 <td></td> 417 <td><code>w<N>dp</code><br/><br/> 418 <br/> 419 <code>w720dp</code><br/> 420 <code>w1024dp</code><br/> 421 422 </td> 423 <td> 424 <p> {@code dp} 425 <code><N></code> 426 427 </p> 428 <p> 429 430 UI 431 UI 432 433 434 </p> 435 <p><em> API 13 </em></p> 436 <p> 437 {@link android.content.res.Configuration#screenWidthDp} </p> 438 <p><a href="{@docRoot}guide/practices/screens_support.html"></a> 439 440 </p> 441 </td> 442 </tr> 443 <tr id="ScreenHeightQualifier"> 444 <td></td> 445 <td><code>h<N>dp</code><br/><br/> 446 <br/> 447 <code>h720dp</code><br/> 448 <code>h1024dp</code><br/> 449 450 </td> 451 <td> 452 <p>dp <code><N></code> 453 454 455 </p> 456 <p> 457 458 UI 459 UI 460 461 462 <em></em> 463 464 465 466 467 <p><em> API 13 </em></p> 468 <p> 469 {@link android.content.res.Configuration#screenHeightDp} </p> 470 <p><a href="{@docRoot}guide/practices/screens_support.html"></a> 471 472 </p> 473 </td> 474 </tr> 475 <tr id="ScreenSizeQualifier"> 476 <td></td> 477 <td> 478 <code>small</code><br/> 479 <code>normal</code><br/> 480 <code>large</code><br/> 481 <code>xlarge</code> 482 </td> 483 <td> 484 <ul class="nolist"> 485 <li>{@code small} 486 QVGA 487 320x426 dp QVGA VGA 488 </li> 489 <li>{@code normal} 490 HVGA 491 320x470 dp WQVGA 492 HVGA WVGA 493 </li> 494 <li>{@code large} 495 VGA 496 480x640 dp 497 VGA WVGA </li> 498 <li>{@code xlarge} 499 HVGA 500 720x960 dp 501 502 <em> API 9 </em></li> 503 </ul> 504 <p class="note"><strong></strong><em></em> 505 <a href="#BestMatch"></a> 506 507 </p> 508 <p class="caution"><strong></strong><em></em><strong></strong> {@code 509 xlarge} 510 511 </p> 512 <p><em> API 4 </em></p> 513 514 <p><a href="{@docRoot}guide/practices/screens_support.html"></a> 515 </p> 516 <p> {@link android.content.res.Configuration#screenLayout} 517 518 </p> 519 </td> 520 </tr> 521 <tr id="ScreenAspectQualifier"> 522 <td></td> 523 <td> 524 <code>long</code><br/> 525 <code>notlong</code> 526 </td> 527 <td> 528 <ul class="nolist"> 529 <li>{@code long} WQVGAWVGAFWVGA</li> 530 <li>{@code notlong} QVGAHVGA VGA</li> 531 </ul> 532 <p><em> API 4 </em></p> 533 <p> 534 </p> 535 <p> {@link android.content.res.Configuration#screenLayout} 536 </p> 537 </td> 538 </tr> 539 <tr id="OrientationQualifier"> 540 <td></td> 541 <td> 542 <code>port</code><br/> 543 <code>land</code> <!-- <br/> 544 <code>square</code> --> 545 </td> 546 <td> 547 <ul class="nolist"> 548 <li>{@code port}</li> 549 <li>{@code land}</li> 550 <!-- Square mode is currently not used. --> 551 </ul> 552 <p> 553 <a href="runtime-changes.html"></a> 554 </p> 555 <p> {@link android.content.res.Configuration#orientation} 556 </p> 557 </td> 558 </tr> 559 <tr id="UiModeQualifier"> 560 <td>UI </td> 561 <td> 562 <code>car</code><br/> 563 <code>desk</code><br/> 564 <code>television</code><br/> 565 <code>appliance</code> 566 <code>watch</code> 567 </td> 568 <td> 569 <ul class="nolist"> 570 <li>{@code car}</li> 571 <li>{@code desk}</li> 572 <li>{@code television} 573 UI 574 575 </li> 576 <li>{@code appliance} 577 </li> 578 <li>{@code watch}</li> 579 </ul> 580 <p><em> API 8 API 13 API 20 </em></p> 581 <p><a href="{@docRoot}training/monitoring-device-state/docking-monitoring.html"></a> 582 583 </p> 584 <p> 585 {@link 586 android.app.UiModeManager} <a href="runtime-changes.html"></a> 587 </p> 588 </td> 589 </tr> 590 <tr id="NightQualifier"> 591 <td></td> 592 <td> 593 <code>night</code><br/> 594 <code>notnight</code> 595 </td> 596 <td> 597 <ul class="nolist"> 598 <li>{@code night}</li> 599 <li>{@code notnight}</li> 600 </ul> 601 <p><em> API 8 </em></p> 602 <p> 603 604 {@link android.app.UiModeManager} <a href="runtime-changes.html"></a> 605 </p> 606 </td> 607 </tr> 608 <tr id="DensityQualifier"> 609 <td> (dpi)</td> 610 <td> 611 <code>ldpi</code><br/> 612 <code>mdpi</code><br/> 613 <code>hdpi</code><br/> 614 <code>xhdpi</code><br/> 615 <code>xxhdpi</code><br/> 616 <code>xxxhdpi</code><br/> 617 <code>nodpi</code><br/> 618 <code>tvdpi</code> 619 </td> 620 <td> 621 <ul class="nolist"> 622 <li>{@code ldpi} 120dpi</li> 623 <li>{@code mdpi} HVGA 624 160dpi</li> 625 <li>{@code hdpi} 240dpi</li> 626 <li>{@code xhdpi} 320dpi<em>API 627 8 </em></li> 628 <li>{@code xxhdpi} 480dpi<em>API 629 16 </em></li> 630 <li>{@code xxxhdpi}<a href="{@docRoot}guide/practices/screens_support.html#xxxhdpi-note"></a> 631 640dpi<em></em> 632 <em>API 633 18 </em></li> 634 <li>{@code nodpi} 635 </li> 636 <li>{@code tvdpi} mdpi hdpi 213dpi 637 mdpi 638 hdpi 639 API 13 </li> 640 </ul> 641 <p> 3:4:6:8:12:16 642 tvdpi 9x9 (ldpi) 12x12 (mdpi)18x18 (hdpi)24x24 (xhdpi) 643 </p> 644 <p> tvdpi 645 1.33*mdpimdpi 646 100px x 100px tvdpi 133px x 133px</p> 647 <p class="note"><strong></strong> 648 <em></em><a href="#BestMatch"></a> 649 650 </p> 651 <p> Android <a href="{@docRoot}guide/practices/screens_support.html"></a> 652 653 </p> 654 </td> 655 </tr> 656 <tr id="TouchscreenQualifier"> 657 <td></td> 658 <td> 659 <code>notouch</code><br/> 660 <code>finger</code> 661 </td> 662 <td> 663 <ul class="nolist"> 664 <li>{@code notouch}</li> 665 <li>{@code finger} 666 </li> 667 </ul> 668 <p> {@link android.content.res.Configuration#touchscreen} 669 </p> 670 </td> 671 </tr> 672 <tr id="KeyboardAvailQualifier"> 673 <td></td> 674 <td> 675 <code>keysexposed</code><br/> 676 <code>keyshidden</code><br/> 677 <code>keyssoft</code> 678 </td> 679 <td> 680 <ul class="nolist"> 681 <li>{@code keysexposed}<em></em> 682 683 684 685 </li> 686 <li>{@code keyshidden}<em></em><em></em> 687 </li> 688 <li>{@code keyssoft} 689 </li> 690 </ul> 691 <p> <code>keysexposed</code> <code>keyssoft</code> 692 693 <code>keysexposed</code> </p> 694 <p> 695 <a href="runtime-changes.html"></a> 696 </p> 697 <p> 698 {@link 699 android.content.res.Configuration#hardKeyboardHidden} {@link 700 android.content.res.Configuration#keyboardHidden}</p> 701 </td> 702 </tr> 703 <tr id="ImeQualifier"> 704 <td></td> 705 <td> 706 <code>nokeys</code><br/> 707 <code>qwerty</code><br/> 708 <code>12key</code> 709 </td> 710 <td> 711 <ul class="nolist"> 712 <li>{@code nokeys}</li> 713 <li>{@code qwerty} 714 715 </li> 716 <li>{@code 12key} 12 717 </li> 718 </ul> 719 <p> {@link android.content.res.Configuration#keyboard} 720 </p> 721 </td> 722 </tr> 723 <tr id="NavAvailQualifier"> 724 <td></td> 725 <td> 726 <code>navexposed</code><br/> 727 <code>navhidden</code> 728 </td> 729 <td> 730 <ul class="nolist"> 731 <li>{@code navexposed}</li> 732 <li>{@code navhidden} 733 </li> 734 </ul> 735 <p> 736 <a href="runtime-changes.html"></a> 737 </p> 738 <p> 739 {@link android.content.res.Configuration#navigationHidden} </p> 740 </td> 741 </tr> 742 <tr id="NavigationQualifier"> 743 <td></td> 744 <td> 745 <code>nonav</code><br/> 746 <code>dpad</code><br/> 747 <code>trackball</code><br/> 748 <code>wheel</code> 749 </td> 750 <td> 751 <ul class="nolist"> 752 <li>{@code nonav} 753 </li> 754 <li>{@code dpad}</li> 755 <li>{@code trackball}</li> 756 <li>{@code wheel}</li> 757 </ul> 758 <p> {@link android.content.res.Configuration#navigation} 759 </p> 760 </td> 761 </tr> 762 <!-- DEPRECATED 763 <tr> 764 <td>Screen dimensions</td> 765 <td>Examples:<br/> 766 <code>320x240</code><br/> 767 <code>640x480</code><br/> 768 etc. 769 </td> 770 <td> 771 <p>The larger dimension must be specified first. <strong>This configuration is deprecated 772 and should not be used</strong>. Instead use "screen size," "wider/taller screens," and "screen 773 orientation" described above.</p> 774 </td> 775 </tr> 776 --> 777 <tr id="VersionQualifier"> 778 <td>API </td> 779 <td><br/> 780 <code>v3</code><br/> 781 <code>v4</code><br/> 782 <code>v7</code><br/> 783 </td> 784 <td> 785 <p> API <code>v1</code> API 786 1 Android 1.0 <code>v4</code> API 4 Android 787 1.6 788 <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">Android API </a></p> 789 </td> 790 </tr> 791 </table> 792 793 794 <p class="note"><strong></strong> Android 1.0 795 Android 796 797 <code>w600dp</code> <code>v13</code> API 13 798 <em></em> 799 <a href="#Compatibility"></a> 800 801 </p> 802 803 804 805 <h3 id="QualifierRules"></h3> 806 807 <p></p> 808 809 <ul> 810 <li><code>drawable-en-rUS-land</code> 811 812 </li> 813 <li><a href="#table2"> 2</a> 814 815 <ul> 816 <li><code>drawable-hdpi-port/</code></li> 817 <li><code>drawable-port-hdpi/</code></li> 818 </ul> 819 </li> 820 <li> 821 <code>res/drawable/drawable-en/</code></li> 822 <li> 823 824 </li> 825 <li> Drawable 826 <code>drawable-rES-rFR/</code> 827 <em></em> 828 <code>drawable-rES/</code> 829 <code>drawable-rFR/</code> 830 <a href="#AliasResources"></a> 831 </li> 832 </ul> 833 834 <p>Android 835 836 Android 837 <a href="#BestMatch"></a> 838 839 Android 840 841 </p> 842 843 844 845 <h3 id="AliasResources"></h3> 846 847 <p> 848 849 850 851 </p> 852 853 <p class="note"><strong></strong> 854 {@code xml/} 855 </p> 856 857 <p> {@code icon.png} 858 859 860 861 {@code icon_ca.png} 862 {@code icon.png} 863 {@code res/drawable/} {@code 864 res/drawable-en-rCA/} 865 {@code res/drawable-fr-rCA/} {@code icon.xml} {@code <bitmap>} {@code icon_ca.png} PNG 866 XML XML </p> 867 868 869 <h4>Drawable</h4> 870 871 <p> Drawable 872 {@code <bitmap>} </p> 873 874 <pre> 875 <?xml version="1.0" encoding="utf-8"?> 876 <bitmap xmlns:android="http://schemas.android.com/apk/res/android" 877 android:src="@drawable/icon_ca" /> 878 </pre> 879 880 <p> 881 {@code icon.xml} {@code res/drawable-en-rCA/} 882 {@code R.drawable.icon} {@code 883 R.drawable.icon_ca} {@code res/drawable/} </p> 884 885 886 <h4></h4> 887 888 <p> {@code <merge>} 889 {@code <include>}</p> 890 891 <pre> 892 <?xml version="1.0" encoding="utf-8"?> 893 <merge> 894 <include layout="@layout/main_ltr"/> 895 </merge> 896 </pre> 897 898 <p> {@code main.xml} 899 {@code R.layout.main} {@code R.layout.main_ltr} 900 </p> 901 902 903 <h4></h4> 904 905 <p> 906 ID </p> 907 908 <pre> 909 <?xml version="1.0" encoding="utf-8"?> 910 <resources> 911 <string name="hello">Hello</string> 912 <string name="hi">@string/hello</string> 913 </resources> 914 </pre> 915 916 <p>{@code R.string.hi} {@code R.string.hello} </p> 917 918 <p> <a href="{@docRoot}guide/topics/resources/more-resources.html"></a> 919 </p> 920 921 <pre> 922 <?xml version="1.0" encoding="utf-8"?> 923 <resources> 924 <color name="yellow">#f00</color> 925 <color name="highlight">@color/red</color> 926 </resources> 927 </pre> 928 929 930 931 932 <h2 id="Compatibility"></h2> 933 934 <p> 935 </p> 936 937 <p><em></em><a href="#LocaleQualifier"></a> {@code 938 values/} 939 940 {@code values/} 941 942 </p> 943 944 <p> 945 {@code 946 layout-land/} {@code layout-port/} {@code layout/} 947 {@code layout-port/} </p> 948 949 <p> 950 Android 951 952 Android 953 Android 954 <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code 955 minSdkVersion}</a> 4<a href="#NightQualifier"></a>{@code night} {@code notnight}API 956 8 Drawable API 4 Drawable {@code notnight} Drawable {@code drawable/} 957 {@code drawable-night/} 958 </p> 959 960 <p> 961 962 </p> 963 964 <p> <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> 4 <a href="#DensityQualifier"></a> Drawable <em></em> Drawable 965 966 Drawable Android 967 968 Drawable 969 </p> 970 971 972 973 <h2 id="BestMatch">Android </h2> 974 975 <p>Android 976 977 Android Drawable 978 </p> 979 980 <pre class="classic no-pretty-print"> 981 drawable/ 982 drawable-en/ 983 drawable-fr-rCA/ 984 drawable-en-port/ 985 drawable-en-notouch-12key/ 986 drawable-port-ldpi/ 987 drawable-port-notouch-12key/ 988 </pre> 989 990 <p></p> 991 992 <p style="margin-left:1em;"> 993 = <code>en-GB</code> <br/> 994 = <code>port</code> <br/> 995 = <code>hdpi</code> <br/> 996 = <code>notouch</code> <br/> 997 = <code>12key</code> 998 </p> 999 1000 <p>Android 1001 {@code drawable-en-port} Drawable</p> 1002 1003 <p> 1004 </p> 1005 1006 1007 <div class="figure" style="width:371px"> 1008 <img src="{@docRoot}images/resources/res-selection-flowchart.png" alt="" height="471" /> 1009 <p class="img-caption"><strong> 2. </strong>Android 1010 </p> 1011 </div> 1012 1013 1014 <ol> 1015 <li> 1016 <p><code>drawable-fr-rCA/</code> 1017 <code>en-GB</code> </p> 1018 <pre class="classic no-pretty-print"> 1019 drawable/ 1020 drawable-en/ 1021 <strike>drawable-fr-rCA/</strike> 1022 drawable-en-port/ 1023 drawable-en-notouch-12key/ 1024 drawable-port-ldpi/ 1025 drawable-port-notouch-12key/ 1026 </pre> 1027 <p class="note"><strong></strong> 1028 1029 hdpi 1030 <code>drawable-port-ldpi/</code> <a href="{@docRoot}guide/practices/screens_support.html"></a> 1031 </p></li> 1032 1033 <li><a href="#table2"> 2</a> MCC 1034 </li> 1035 <li> </li> 1036 <ul> 1037 <li> 2 1038 </li> 1039 <li> 4 </li> 1040 </ul> 1041 </li> 1042 1043 <li> 1044 </li> 1045 <pre class="classic no-pretty-print"> 1046 <strike>drawable/</strike> 1047 drawable-en/ 1048 drawable-en-port/ 1049 drawable-en-notouch-12key/ 1050 <strike>drawable-port-ldpi/</strike> 1051 <strike>drawable-port-notouch-12key/</strike> 1052 </pre> 1053 <p class="note"><strong></strong> 1054 Android 1055 Android 1056 <a href="{@docRoot}guide/practices/screens_support.html"></a> 1057 </p> 1058 </li> 1059 1060 <li> 2 3 4 1061 1062 1063 <pre class="classic no-pretty-print"> 1064 <strike>drawable-en/</strike> 1065 drawable-en-port/ 1066 <strike>drawable-en-notouch-12key/</strike> 1067 </pre> 1068 <p> {@code drawable-en-port}</p> 1069 </li> 1070 </ol> 1071 1072 <p> 1073 1074 en<em></em> 1075 1076 1077 </p> 1078 1079 <p> 1080 1081 <strong></strong> {@code xlarge} <em></em> 1082 1083 1084 1085 </p> 1086 1087 <p class="note"><strong></strong><a href="#table2"> 1088 2</a> <em></em> 1089 4 1090 <code>drawable-en</code> 1091 1092 <code>drawable-port-notouch-12key</code> </p> 1093 1094 <p><a href="accessing-resources.html"></a></p> 1095