Loading docs/html/images/tools/sdk-manager-support-libs.png +36.7 KiB (89.3 KiB) Loading image diff... docs/html/topic/libraries/support-library/features.jd +18 −145 Original line number Diff line number Diff line Loading @@ -141,19 +141,13 @@ page.title=Support Library Features API reference. </p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v4/</code> directory. The library does not contain user interface resources. To include it in your application project, follow the instructions for <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without resources</a>.</p> <p class="caution"><strong>Caution:</strong> Using dynamic dependencies, especially for higher version numbers, can cause unexpected version updates and regression incompatibilities.</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:support-v4:23.3.0 com.android.support:support-v4:24.1.1 </pre> Loading @@ -167,15 +161,6 @@ com.android.support:support-v4:23.3.0 Building Apps with Over 64K Methods</a>. </p> <p> After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/multidex/</code> directory. The library does not contain user interface resources. To include it in your application project, follow the instructions for <a href= "{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without resources</a>. </p> <p> The Gradle build script dependency identifier for this library is as follows: </p> Loading Loading @@ -228,16 +213,10 @@ com.android.support:multidex:1.0.0 </li> </ul> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v7/appcompat/</code> directory. The library contains user interface resources. To include it in your application project, follow the instructions for <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>.</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:appcompat-v7:23.3.0 com.android.support:appcompat-v7:24.1.1 </pre> Loading @@ -249,16 +228,10 @@ widget, which lets you show information inside cards that have a consistent look on any app. These cards are useful for material design implementations, and are used extensively in layouts for TV apps.</p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v7/cardview/</code> directory. The library contains user interface resources. To include it in your application project, follow the instructions for <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>.</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:cardview-v7:23.3.0 com.android.support:cardview-v7:24.1.1 </pre> Loading @@ -271,16 +244,10 @@ allows you to arrange user interface elements using a grid of rectangular cells. For detailed information about the v7 gridlayout library APIs, see the {@link android.support.v7.widget android.support.v7.widget} package in the API reference.</p> <p>This library is located in the <code><sdk>/extras/android/support/v7/gridlayout/</code> directory . The library contains user interface resources. To include it in your application project, follow the instructions for <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>.</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:gridlayout-v7:23.3.0 com.android.support:gridlayout-v7:24.1.1 </pre> Loading @@ -300,21 +267,10 @@ information about the v7 mediarouter library APIs, see the {@link android.support.v7.media android.support.v7.media} package in the API reference.</p> <p>The v7 mediarouter library is located in the <code><sdk>/extras/android/support/v7/mediarouter/</code> directory after you download the Android Support Library. It's provided as a library project with a dependency on the v7 appcompat library, so you'll need to include both libraries in your build path when setting up your project. For more information on how to set up your project, follow the instructions in <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>.</p> <p>The Gradle builder script dependency identifier is as follows: <code>com.android.support:support-v7-mediarouter:<revision></code>, where "<revision>" is the minimum revision at which the library is available. For example:</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:mediarouter-v7:23.3.0 com.android.support:mediarouter-v7:24.1.1 </pre> <p class="caution">The v7 mediarouter library APIs introduced in Support Library Loading @@ -331,16 +287,10 @@ prominent colors from an image. For example, a music app could use a from an album cover, and use those colors to build a color-coordinated song title card.</p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v7/palette/</code> directory. The library does not contain user interface resources. To include it in your application project, follow the instructions for <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without resources</a>.</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:palette-v7:23.3.0 com.android.support:palette-v7:24.1.1 </pre> Loading @@ -353,16 +303,10 @@ class. This class provides support for the widget, a view for efficiently displaying large data sets by providing a limited window of data items.</p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v7/recyclerview/</code> directory. The library contains user interface resources. To include it in your application project, follow the instructions for <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>.</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:recyclerview-v7:23.3.0 com.android.support:recyclerview-v7:24.1.1 </pre> Loading @@ -382,25 +326,12 @@ such as {@link android.support.v7.preference.CheckBoxPreference} and {@link android.support.v7.preference.ListPreference}. </p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v7/preference</code> directory. For more information on how to set up your project, follow the instructions in <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>. </p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:preference-v7:23.3.0 com.android.support:preference-v7:24.1.1 </pre> <h2 id="v8">v8 Support Library</h2> <p>This library is designed to be used with Android 2.2 (API level 8) and higher. Loading Loading @@ -446,16 +377,10 @@ defaultConfig { android.support.v13} package in the API reference. </p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v13/</code> directory. The library does not contain user interface resources. To include it in your application project, follow the instructions for <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without resources</a>.</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:support-v13:23.3.0 com.android.support:support-v13:24.1.1 </pre> Loading @@ -478,16 +403,10 @@ for preference interfaces such as package in the API reference. </p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v14/</code> directory. The library does not contain user interface resources. To include it in your application project, follow the instructions for <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without resources</a>.</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:preference-v14:23.3.0 com.android.support:preference-v14:24.1.1 </pre> Loading @@ -507,16 +426,10 @@ interface and classes, such as package in the API reference. </p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v17/</code> directory. The library does not contain user interface resources. To include it in your application project, follow the instructions for <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without resources</a>.</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:preference-leanback-v17:23.3.0 com.android.support:preference-leanback-v17:24.1.1 </pre> Loading Loading @@ -549,16 +462,10 @@ com.android.support:preference-leanback-v17:23.3.0 into a {@link android.support.v17.leanback.app.RowsFragment}.</li> </ul> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v17/leanback</code> directory. For more information on how to set up your project, follow the instructions in <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>. </p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:leanback-v17:23.3.0 com.android.support:leanback-v17:24.1.1 </pre> Loading @@ -570,16 +477,10 @@ package provides APIs to support adding annotation metadata to your apps. </p> <p></p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/annotations</code> directory. For more information on how to set up your project, follow the instructions in <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>. </p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:support-annotations:23.3.0 com.android.support:support-annotations:24.1.1 </pre> Loading @@ -594,17 +495,10 @@ provides APIs to support adding material design components and patterns to your app developers to build upon, such as navigation drawers, floating action buttons (<i>FAB</i>), snackbars, and <a href="{@docRoot}design/building-blocks/tabs.html">tabs</a>. </p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/design</code> directory. For more information on how to set up your project, follow the instructions in <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>. </p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:design:23.3.0 com.android.support:design:24.1.1 </pre> Loading @@ -622,17 +516,10 @@ and <a href="{@docRoot}reference/android/support/customtabs/CustomTabsCallback.html">Custom Tabs Callback</a>. </p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/customtabs</code> directory. For more information on how to set up your project, follow the instructions in <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>. </p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:customtabs:23.3.0 com.android.support:customtabs:24.1.1 </pre> Loading @@ -653,17 +540,10 @@ and <a href="{@docRoot}reference/android/support/percent/PercentRelativeLayout.html"> PercentRelativeLayout</a>. </p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/percent</code> directory. For more information on how to set up your project, follow the instructions in <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>. </p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:percent:23.3.0 com.android.support:percent:24.1.1 </pre> Loading @@ -683,15 +563,8 @@ and <a href="{@docRoot}reference/android/support/app/recommendation/RecommendationExtender.html"> RecommendationExtender</a>. </p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/recommendation</code> directory. For more information on how to set up your project, follow the instructions in <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>. </p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:recommendation:23.3.0 com.android.support:recommendation:24.1.1 </pre> docs/html/topic/libraries/support-library/setup.jd +10 −73 Original line number Diff line number Diff line Loading @@ -10,18 +10,12 @@ page.title=Support Library Setup <ol> <li><a href="#download">Downloading the Support Library</a></li> <li><a href="#choosing">Choosing Support Libraries</a></li> <li><a href="#add-library">Adding Support Libraries</a> <ol> <li><a href="#libs-without-res">Adding libraries without resources</a></li> <li><a href="#libs-with-res">Adding libraries with resources</a></li> </ol> </li> <li><a href="#add-library">Adding Support Libraries</a></li> <li><a href="#using-apis">Using Support Library APIs</a> <ol> <li><a href="#manifest">Manifest Declaration Changes</a></li> </ol> </li> <li><a href="#samples">Code Samples</a></li> </ol> <h2>See also</h2> Loading @@ -45,8 +39,8 @@ page.title=Support Library Setup <h2 id="download">Downloading the Support Libraries</h2> <p>The Android Support Library package is provided as a supplemental download to the Android SDK and is available through the Android <p>The Android Support Repository package is provided as a supplemental download to the Android SDK and is available through the Android <a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a>. Follow the instructions below to obtain the Support Library files. </p> Loading @@ -57,22 +51,18 @@ page.title=Support Library Setup <li>Start the Android <a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a>.</li> <li>In the SDK Manager window, scroll to the end of the <em>Packages</em> list, find the <em>Extras</em> folder and, if necessary, expand to show its contents.</li> <li>Select the <strong>Android Support Library</strong> item. <p class="note"> <strong>Note:</strong> If you're developing with Android Studio, select and install the <strong>Android Support Repository</strong> item instead. </p> </li> <li>Select the <strong>Android Support Repository</strong> item.</li> <li>Click the <strong>Install packages...</strong> button.</li> </ol> <img src="{@docRoot}images/tools/sdk-manager-support-libs.png" width="525" alt="" /> <p class="img-caption"><strong>Figure 1.</strong> The Android SDK Manager with the Android Support Library selected.</p> <p class="img-caption"><strong>Figure 1.</strong> The Android SDK Manager with Android Support Repository selected.</p> <p>After downloading, the tool installs the Support Library files to your existing Android SDK directory. The library files are located in the following subdirectory of your SDK: {@code <sdk>/extras/android/support/} directory.</p> <code><sdk>/extras/android/m2repository/com/android/support/</code> directory.</p> <h2 id="choosing">Choosing Support Libraries</h2> Loading @@ -89,20 +79,7 @@ Android Support Library selected.</p> classpath dependencies within your development environment. You must perform this procedure for each Support Library you want to use.</p> <p>Some Support Libraries contain resources beyond compiled code classes, such as images or XML files. For example, the <a href="{@docRoot}tools/support-library/features.html#v7-appcompat">v7 appcompat</a> and <a href="{@docRoot}tools/support-library/features.html#v7-gridlayout">v7 gridlayout</a> libraries include resources.</p> <p>If you are not sure if a library contains resources, check the <a href="{@docRoot}tools/support-library/features.html">Support Library Features</a> page. The following sections describe how to add a Support Library with or without resources to your application project. </p> <h3 id="libs-without-res">Adding libraries without resources</h3> <p>To add a Support Library without resources to your application project:</p> <p>To add a Support Library to your application project:</p> <ol> <li>Make sure you have downloaded the <strong>Android Support Repository</strong> Loading @@ -113,37 +90,12 @@ Android Support Library selected.</p> <pre> dependencies { ... <b>compile "com.android.support:support-v4:18.0.+"</b> <b>compile "com.android.support:support-v4:24.1.1"</b> } </pre> </li> </ol> <h3 id="libs-with-res">Adding libraries with resources</h3> <p>To add a Support Library with resources (such as <a href="{@docRoot}tools/support-library/features.html#v7-appcompat">v7 appcompat</a> for action bar) to your application project:</p> <ol> <li>Make sure you have downloaded the <strong>Android Support Repository</strong> using the <a href="#download">SDK Manager</a>.</li> <li>Open the {@code build.gradle} file for your application.</li> <li>Add the support library feature project identifier to the {@code dependencies} section. For example, to include the {@code appcompat} project add {@code compile "com.android.support:appcompat-v7:18.0.+"} to the dependencies section, as shown in the following example: <pre> dependencies { ... <b>compile "com.android.support:appcompat-v7:18.0.+"</b> } </pre> </li> </ol> <h2 id="using-apis">Using Support Library APIs</h2> <p>Support Library classes that provide support for existing framework APIs typically have the Loading Loading @@ -224,18 +176,3 @@ android { <code>"4"</code>). The highest support library level you include in your application determines the lowest API version in which it can operate. </p> <h2 id="samples">Code Samples</h2> <p>Each Support Library includes code samples to help you get started using the support APIs. The code is included in the download from the SDK Manager and is placed inside the Android SDK installation directory, as listed below:</p> <ul> <li>4v Samples: {@code <sdk>/extras/android/support/samples/Support4Demos/}</li> <li>7v Samples: {@code <sdk>/extras/android/support/samples/Support7Demos/}</li> <li>13v Samples: {@code <sdk>/extras/android/support/samples/Support13Demos/}</li> <li>App Navigation: {@code <sdk>/extras/android/support/samples/SupportAppNavigation/}</li> </ul> Loading
docs/html/topic/libraries/support-library/features.jd +18 −145 Original line number Diff line number Diff line Loading @@ -141,19 +141,13 @@ page.title=Support Library Features API reference. </p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v4/</code> directory. The library does not contain user interface resources. To include it in your application project, follow the instructions for <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without resources</a>.</p> <p class="caution"><strong>Caution:</strong> Using dynamic dependencies, especially for higher version numbers, can cause unexpected version updates and regression incompatibilities.</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:support-v4:23.3.0 com.android.support:support-v4:24.1.1 </pre> Loading @@ -167,15 +161,6 @@ com.android.support:support-v4:23.3.0 Building Apps with Over 64K Methods</a>. </p> <p> After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/multidex/</code> directory. The library does not contain user interface resources. To include it in your application project, follow the instructions for <a href= "{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without resources</a>. </p> <p> The Gradle build script dependency identifier for this library is as follows: </p> Loading Loading @@ -228,16 +213,10 @@ com.android.support:multidex:1.0.0 </li> </ul> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v7/appcompat/</code> directory. The library contains user interface resources. To include it in your application project, follow the instructions for <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>.</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:appcompat-v7:23.3.0 com.android.support:appcompat-v7:24.1.1 </pre> Loading @@ -249,16 +228,10 @@ widget, which lets you show information inside cards that have a consistent look on any app. These cards are useful for material design implementations, and are used extensively in layouts for TV apps.</p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v7/cardview/</code> directory. The library contains user interface resources. To include it in your application project, follow the instructions for <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>.</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:cardview-v7:23.3.0 com.android.support:cardview-v7:24.1.1 </pre> Loading @@ -271,16 +244,10 @@ allows you to arrange user interface elements using a grid of rectangular cells. For detailed information about the v7 gridlayout library APIs, see the {@link android.support.v7.widget android.support.v7.widget} package in the API reference.</p> <p>This library is located in the <code><sdk>/extras/android/support/v7/gridlayout/</code> directory . The library contains user interface resources. To include it in your application project, follow the instructions for <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>.</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:gridlayout-v7:23.3.0 com.android.support:gridlayout-v7:24.1.1 </pre> Loading @@ -300,21 +267,10 @@ information about the v7 mediarouter library APIs, see the {@link android.support.v7.media android.support.v7.media} package in the API reference.</p> <p>The v7 mediarouter library is located in the <code><sdk>/extras/android/support/v7/mediarouter/</code> directory after you download the Android Support Library. It's provided as a library project with a dependency on the v7 appcompat library, so you'll need to include both libraries in your build path when setting up your project. For more information on how to set up your project, follow the instructions in <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>.</p> <p>The Gradle builder script dependency identifier is as follows: <code>com.android.support:support-v7-mediarouter:<revision></code>, where "<revision>" is the minimum revision at which the library is available. For example:</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:mediarouter-v7:23.3.0 com.android.support:mediarouter-v7:24.1.1 </pre> <p class="caution">The v7 mediarouter library APIs introduced in Support Library Loading @@ -331,16 +287,10 @@ prominent colors from an image. For example, a music app could use a from an album cover, and use those colors to build a color-coordinated song title card.</p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v7/palette/</code> directory. The library does not contain user interface resources. To include it in your application project, follow the instructions for <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without resources</a>.</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:palette-v7:23.3.0 com.android.support:palette-v7:24.1.1 </pre> Loading @@ -353,16 +303,10 @@ class. This class provides support for the widget, a view for efficiently displaying large data sets by providing a limited window of data items.</p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v7/recyclerview/</code> directory. The library contains user interface resources. To include it in your application project, follow the instructions for <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>.</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:recyclerview-v7:23.3.0 com.android.support:recyclerview-v7:24.1.1 </pre> Loading @@ -382,25 +326,12 @@ such as {@link android.support.v7.preference.CheckBoxPreference} and {@link android.support.v7.preference.ListPreference}. </p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v7/preference</code> directory. For more information on how to set up your project, follow the instructions in <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>. </p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:preference-v7:23.3.0 com.android.support:preference-v7:24.1.1 </pre> <h2 id="v8">v8 Support Library</h2> <p>This library is designed to be used with Android 2.2 (API level 8) and higher. Loading Loading @@ -446,16 +377,10 @@ defaultConfig { android.support.v13} package in the API reference. </p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v13/</code> directory. The library does not contain user interface resources. To include it in your application project, follow the instructions for <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without resources</a>.</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:support-v13:23.3.0 com.android.support:support-v13:24.1.1 </pre> Loading @@ -478,16 +403,10 @@ for preference interfaces such as package in the API reference. </p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v14/</code> directory. The library does not contain user interface resources. To include it in your application project, follow the instructions for <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without resources</a>.</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:preference-v14:23.3.0 com.android.support:preference-v14:24.1.1 </pre> Loading @@ -507,16 +426,10 @@ interface and classes, such as package in the API reference. </p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v17/</code> directory. The library does not contain user interface resources. To include it in your application project, follow the instructions for <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without resources</a>.</p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:preference-leanback-v17:23.3.0 com.android.support:preference-leanback-v17:24.1.1 </pre> Loading Loading @@ -549,16 +462,10 @@ com.android.support:preference-leanback-v17:23.3.0 into a {@link android.support.v17.leanback.app.RowsFragment}.</li> </ul> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/v17/leanback</code> directory. For more information on how to set up your project, follow the instructions in <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>. </p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:leanback-v17:23.3.0 com.android.support:leanback-v17:24.1.1 </pre> Loading @@ -570,16 +477,10 @@ package provides APIs to support adding annotation metadata to your apps. </p> <p></p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/annotations</code> directory. For more information on how to set up your project, follow the instructions in <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>. </p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:support-annotations:23.3.0 com.android.support:support-annotations:24.1.1 </pre> Loading @@ -594,17 +495,10 @@ provides APIs to support adding material design components and patterns to your app developers to build upon, such as navigation drawers, floating action buttons (<i>FAB</i>), snackbars, and <a href="{@docRoot}design/building-blocks/tabs.html">tabs</a>. </p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/design</code> directory. For more information on how to set up your project, follow the instructions in <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>. </p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:design:23.3.0 com.android.support:design:24.1.1 </pre> Loading @@ -622,17 +516,10 @@ and <a href="{@docRoot}reference/android/support/customtabs/CustomTabsCallback.html">Custom Tabs Callback</a>. </p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/customtabs</code> directory. For more information on how to set up your project, follow the instructions in <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>. </p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:customtabs:23.3.0 com.android.support:customtabs:24.1.1 </pre> Loading @@ -653,17 +540,10 @@ and <a href="{@docRoot}reference/android/support/percent/PercentRelativeLayout.html"> PercentRelativeLayout</a>. </p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/percent</code> directory. For more information on how to set up your project, follow the instructions in <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>. </p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:percent:23.3.0 com.android.support:percent:24.1.1 </pre> Loading @@ -683,15 +563,8 @@ and <a href="{@docRoot}reference/android/support/app/recommendation/RecommendationExtender.html"> RecommendationExtender</a>. </p> <p>After you download the Android Support Libraries, this library is located in the <code><sdk>/extras/android/support/recommendation</code> directory. For more information on how to set up your project, follow the instructions in <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with resources</a>. </p> <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:recommendation:23.3.0 com.android.support:recommendation:24.1.1 </pre>
docs/html/topic/libraries/support-library/setup.jd +10 −73 Original line number Diff line number Diff line Loading @@ -10,18 +10,12 @@ page.title=Support Library Setup <ol> <li><a href="#download">Downloading the Support Library</a></li> <li><a href="#choosing">Choosing Support Libraries</a></li> <li><a href="#add-library">Adding Support Libraries</a> <ol> <li><a href="#libs-without-res">Adding libraries without resources</a></li> <li><a href="#libs-with-res">Adding libraries with resources</a></li> </ol> </li> <li><a href="#add-library">Adding Support Libraries</a></li> <li><a href="#using-apis">Using Support Library APIs</a> <ol> <li><a href="#manifest">Manifest Declaration Changes</a></li> </ol> </li> <li><a href="#samples">Code Samples</a></li> </ol> <h2>See also</h2> Loading @@ -45,8 +39,8 @@ page.title=Support Library Setup <h2 id="download">Downloading the Support Libraries</h2> <p>The Android Support Library package is provided as a supplemental download to the Android SDK and is available through the Android <p>The Android Support Repository package is provided as a supplemental download to the Android SDK and is available through the Android <a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a>. Follow the instructions below to obtain the Support Library files. </p> Loading @@ -57,22 +51,18 @@ page.title=Support Library Setup <li>Start the Android <a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a>.</li> <li>In the SDK Manager window, scroll to the end of the <em>Packages</em> list, find the <em>Extras</em> folder and, if necessary, expand to show its contents.</li> <li>Select the <strong>Android Support Library</strong> item. <p class="note"> <strong>Note:</strong> If you're developing with Android Studio, select and install the <strong>Android Support Repository</strong> item instead. </p> </li> <li>Select the <strong>Android Support Repository</strong> item.</li> <li>Click the <strong>Install packages...</strong> button.</li> </ol> <img src="{@docRoot}images/tools/sdk-manager-support-libs.png" width="525" alt="" /> <p class="img-caption"><strong>Figure 1.</strong> The Android SDK Manager with the Android Support Library selected.</p> <p class="img-caption"><strong>Figure 1.</strong> The Android SDK Manager with Android Support Repository selected.</p> <p>After downloading, the tool installs the Support Library files to your existing Android SDK directory. The library files are located in the following subdirectory of your SDK: {@code <sdk>/extras/android/support/} directory.</p> <code><sdk>/extras/android/m2repository/com/android/support/</code> directory.</p> <h2 id="choosing">Choosing Support Libraries</h2> Loading @@ -89,20 +79,7 @@ Android Support Library selected.</p> classpath dependencies within your development environment. You must perform this procedure for each Support Library you want to use.</p> <p>Some Support Libraries contain resources beyond compiled code classes, such as images or XML files. For example, the <a href="{@docRoot}tools/support-library/features.html#v7-appcompat">v7 appcompat</a> and <a href="{@docRoot}tools/support-library/features.html#v7-gridlayout">v7 gridlayout</a> libraries include resources.</p> <p>If you are not sure if a library contains resources, check the <a href="{@docRoot}tools/support-library/features.html">Support Library Features</a> page. The following sections describe how to add a Support Library with or without resources to your application project. </p> <h3 id="libs-without-res">Adding libraries without resources</h3> <p>To add a Support Library without resources to your application project:</p> <p>To add a Support Library to your application project:</p> <ol> <li>Make sure you have downloaded the <strong>Android Support Repository</strong> Loading @@ -113,37 +90,12 @@ Android Support Library selected.</p> <pre> dependencies { ... <b>compile "com.android.support:support-v4:18.0.+"</b> <b>compile "com.android.support:support-v4:24.1.1"</b> } </pre> </li> </ol> <h3 id="libs-with-res">Adding libraries with resources</h3> <p>To add a Support Library with resources (such as <a href="{@docRoot}tools/support-library/features.html#v7-appcompat">v7 appcompat</a> for action bar) to your application project:</p> <ol> <li>Make sure you have downloaded the <strong>Android Support Repository</strong> using the <a href="#download">SDK Manager</a>.</li> <li>Open the {@code build.gradle} file for your application.</li> <li>Add the support library feature project identifier to the {@code dependencies} section. For example, to include the {@code appcompat} project add {@code compile "com.android.support:appcompat-v7:18.0.+"} to the dependencies section, as shown in the following example: <pre> dependencies { ... <b>compile "com.android.support:appcompat-v7:18.0.+"</b> } </pre> </li> </ol> <h2 id="using-apis">Using Support Library APIs</h2> <p>Support Library classes that provide support for existing framework APIs typically have the Loading Loading @@ -224,18 +176,3 @@ android { <code>"4"</code>). The highest support library level you include in your application determines the lowest API version in which it can operate. </p> <h2 id="samples">Code Samples</h2> <p>Each Support Library includes code samples to help you get started using the support APIs. The code is included in the download from the SDK Manager and is placed inside the Android SDK installation directory, as listed below:</p> <ul> <li>4v Samples: {@code <sdk>/extras/android/support/samples/Support4Demos/}</li> <li>7v Samples: {@code <sdk>/extras/android/support/samples/Support7Demos/}</li> <li>13v Samples: {@code <sdk>/extras/android/support/samples/Support13Demos/}</li> <li>App Navigation: {@code <sdk>/extras/android/support/samples/SupportAppNavigation/}</li> </ul>