1page.title=Support Library Features 2 3@jd:body 4 5<div id="qv-wrapper"> 6 <div id="qv"> 7 8 <h2>In this document</h2> 9 <ol> 10 <li><a href="#v4">v4 Support Library</a></li> 11 <li><a href="#multidex">Multidex Support Library</a></li> 12 <li><a href="#v7">v7 Support Libraries</a> 13 <ol> 14 <li><a href="#v7-appcompat">v7 appcompat library</a></li> 15 <li><a href="#v7-cardview">v7 cardview library</a></li> 16 <li><a href="#v7-gridlayout">v7 gridlayout library</a></li> 17 <li><a href="#v7-mediarouter">v7 mediarouter library</a></li> 18 <li><a href="#v7-palette">v7 palette library</a></li> 19 <li><a href="#v7-recyclerview">v7 recyclerview library</a></li> 20 </ol> 21 </li> 22 <li><a href="#v8">v8 Support Library</a></li> 23 <li><a href="#v13">v13 Support Library</a></li> 24 <li><a href="#v17-leanback">v17 Leanback Library</a></li> 25 </ol> 26 27 <h2>See also</h2> 28 <ol> 29 <li><a href="{@docRoot}tools/support-library/index.html#revisions"> 30 Support Library Revisions</a></li> 31 <li><a href="{@docRoot}tools/support-library/setup.html"> 32 Support Library Setup</a></li> 33 </ol> 34 35 </div> 36</div> 37 38<p>The Android Support Library package contains several libraries that can be included 39 in your application. Each of these libraries supports a specific range of Android platform 40 versions and set of features.</p> 41 42<p>This guide explains the important features and version support provided by the Support 43 Libraries to help you decide which of them you should include in your application. In general, 44 we recommend including the <a href="#v4">v4 support</a> and <a href="#v7-appcompat">v7 45 appcompat</a> libraries, because they support a wide range of 46 Android versions and provide APIs for recommended user interface patterns.</p> 47 48<p>In order to use any of the following libraries, you must download the library files to your 49 Android SDK installation. Follow the directions for downloading the Support Libraries in 50 <a href="{@docRoot}tools/support-library/setup.html#download">Support Library Setup</a> to 51 complete this step. You must take additional steps to include a specific Support Library in 52 your application. See the end of each library section below for important information on how to 53 include the library in your application.</p> 54 55 56<h2 id="v4">v4 Support Library</h2> 57 58<p>This library is designed to be used with Android 1.6 (API level 4) and higher. It includes the 59 largest set of APIs compared to the other libraries, including support for application components, 60 user interface features, accessibility, data handling, network connectivity, and programming 61 utilities. Here are a few of the key classes included in the v4 library:</p> 62 63<ul> 64 <li>App Components 65 <ul> 66 <li>{@link android.support.v4.app.Fragment} 67 - Adds support for encapsulation of user interface and functionality 68 with Fragments, enabling 69 applications to provide layouts that adjust between small and 70 large-screen devices. 71 </li> 72 73 <li>{@link android.support.v4.app.NotificationCompat} - Adds support for rich notification 74 features.</li> 75 <li>{@link android.support.v4.content.LocalBroadcastManager} - Allows applications to easily 76 register for and receive intents within a single application without broadcasting them 77 globally.</li> 78 </ul> 79 </li> 80 <li>User Interface 81 <ul> 82 <li>{@link android.support.v4.view.ViewPager} - Adds a 83 {@link android.view.ViewGroup} that manages the layout for the 84 child views, which the user can swipe between.</li> 85 <li>{@link android.support.v4.view.PagerTitleStrip} 86 - Adds a non-interactive title strip, that can be added as a child of 87 {@link android.support.v4.view.ViewPager}.</li> 88 <li>{@link android.support.v4.view.PagerTabStrip} - Adds a 89 navigation widget for switching between paged views, that can also be used with 90 {@link android.support.v4.view.ViewPager}.</li> 91 <li>{@link android.support.v4.widget.DrawerLayout} - Adds 92 support for creating a <a href="{@docRoot}training/implementing-navigation/nav-drawer.html" 93 >Navigation Drawer</a> that can be pulled in from the edge of a window.</li> 94 <li>{@link android.support.v4.widget.SlidingPaneLayout} 95 - Adds widget for creating linked summary and detail views that 96 appropriately adapt to various screen sizes.</li> 97 </ul> 98 </li> 99 <li>Accessibility 100 <ul> 101 <li>{@link android.support.v4.widget.ExploreByTouchHelper} 102 - Adds a helper class for implementing accessibility support for custom views.</li> 103 <li>{@link android.support.v4.view.accessibility.AccessibilityEventCompat} - Adds support for 104 {@link android.view.accessibility.AccessibilityEvent}. For more information about implementing 105 accessibility, see <a href="{@docRoot}guide/topics/ui/accessibility/index.html" 106 >Accessibility</a>.</li> 107 108 <li>{@link android.support.v4.view.accessibility.AccessibilityNodeInfoCompat} - Adds support 109 for {@link android.view.accessibility.AccessibilityNodeInfo}.</li> 110 <li>{@link android.support.v4.view.accessibility.AccessibilityNodeProviderCompat} - Adds 111 support for {@link android.view.accessibility.AccessibilityNodeProvider}.</li> 112 <li>{@link android.support.v4.view.AccessibilityDelegateCompat} - Adds support for 113 {@link android.view.View.AccessibilityDelegate}.</li> 114 </ul> 115 </li> 116 <li>Content 117 <ul> 118 <li>{@link android.support.v4.content.Loader} - Adds support for asynchronous loading of data. 119 The library also provides concrete implementations of this class, including 120 {@link android.support.v4.content.CursorLoader} and 121 {@link android.support.v4.content.AsyncTaskLoader}.</li> 122 <li>{@link android.support.v4.content.FileProvider} - Adds support for sharing of private 123 files between applications.</li> 124 </ul> 125 </li> 126</ul> 127 128<p> 129 There are many other APIs included in this library. For complete, detailed information about the 130 v4 Support Library APIs, see the {@link android.support.v4.app android.support.v4} package in the 131 API reference. 132</p> 133 134<p>This library is located in the {@code <sdk>/extras/android/support/v4/} directory after 135 you download the Android Support Libraries. The library does not contain user interface 136 resources. To include it in your application project, follow the instructions for 137 <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without 138 resources</a>.</p> 139 140<p class="caution"><strong>Caution:</strong> Using dynamic dependencies, especially for higher version 141numbers, can cause unexpected version updates and regression incompatibilities.</p> 142 143<p>The Gradle build script dependency identifier for this library is as follows:</p> 144 145<pre> 146com.android.support:support-v4:21.0.0 147</pre> 148 149 150 151<h2 id="multidex">Multidex Support Library</h2> 152 153<p> 154 This library provides support for building apps with multiple Dalvik Executable (DEX) files. 155 Apps that reference more than 65536 methods are required to use multidex configurations. For 156 more information about using multidex, see <a href="{@docRoot}tools/building/multidex.html"> 157 Building Apps with Over 65K Methods</a>. 158</p> 159 160<p> 161 This library is located in the {@code <sdk>/extras/android/support/multidex/} directory 162 after you download the Android Support Libraries. The library does not contain user interface 163 resources. To include it in your application project, follow the instructions for <a href= 164 "{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without 165 resources</a>. 166</p> 167 168<p> 169 The Gradle build script dependency identifier for this library is as follows: 170</p> 171 172<pre> 173com.android.support:multidex:1.0.0 174</pre> 175 176 177 178<h2 id="v7">v7 Support Libraries</h2> 179 180<p>There are several libraries designed to be used with Android 2.1 (API level 7) and higher. 181 These libraries provide specific feature sets and can be included in your application 182 independently from each other.</p> 183 184 185<h3 id="v7-appcompat">v7 appcompat library</h3> 186 187<p>This library adds support for the 188 <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> user 189 interface <a href="{@docRoot}design/patterns/actionbar.html">design 190 pattern</a>. This library includes support for 191 <a href="{@docRoot}design/material/">material design</a> user interface 192 implementations. 193</p> 194 195<p class="note"><strong>Note:</strong> 196 This library depends on the v4 Support Library. If you are using Ant or Eclipse, make sure 197 you include the v4 Support Library as part of this library's classpath. 198</p> 199 200<p>Here are a few of the key classes included in the v7 appcompat library:</p> 201 202<ul> 203 <li>{@link android.support.v7.app.ActionBar} - Provides an implementation of the action bar 204 <a href="{@docRoot}design/patterns/actionbar.html">user interface pattern</a>. For more 205 information on using the Action Bar, see the 206 <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guide. 207 </li> 208 <li>{@link android.support.v7.app.ActionBarActivity} - Adds an application activity class that 209 must be used as a base class for activities that uses the Support Library action bar 210 implementation. 211 </li> 212 <li>{@link android.support.v7.widget.ShareActionProvider} - Adds support for a standardized 213 sharing action (such as email or posting to social applications) that can be included in an 214 action bar. 215 </li> 216</ul> 217 218<p>This library is located in the {@code <sdk>/extras/android/support/v7/appcompat/} 219 directory after you download the Android Support Libraries. The library contains user 220 interface resources. To include it in your application project, follow the instructions for 221 <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with 222 resources</a>.</p> 223 224<p>The Gradle build script dependency identifier for this library is as follows:</p> 225 226<pre> 227com.android.support:appcompat-v7:21.0.0 228</pre> 229 230 231 232<h3 id="v7-cardview">v7 cardview library</h3> 233 234<p>This library adds support for the {@link android.support.v7.widget.CardView} 235widget, which lets you show information inside cards that have a consistent look 236on any app. These cards are useful for material design 237implementations, and are used extensively in layouts for TV apps.</p> 238 239<p>This library is located in the 240{@code <sdk>/extras/android/support/v7/cardview/} directory after you 241download the Android Support Libraries. The library contains user interface 242resources. To include it in your application project, follow the instructions 243for <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding 244libraries with resources</a>.</p> 245 246<p>The Gradle build script dependency identifier for this library is as follows:</p> 247 248<pre> 249com.android.support:cardview-v7:21.0.0 250</pre> 251 252 253 254<h3 id="v7-gridlayout">v7 gridlayout library</h3> 255 256<p>This library adds support for the {@link android.support.v7.widget.GridLayout} class, which 257 allows you to arrange user interface elements using a grid of rectangular cells. 258 For detailed information about the v7 gridlayout library APIs, see the 259 {@link android.support.v7.widget android.support.v7.widget} package in the API reference.</p> 260 261<p>This library is located in the {@code <sdk>/extras/android/support/v7/gridlayout/} 262 directory after you download the Android Support Libraries. The library contains user 263 interface resources. To include it in your application project, follow the instructions for 264 <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with 265 resources</a>.</p> 266 267<p>The Gradle build script dependency identifier for this library is as follows:</p> 268 269<pre> 270com.android.support:gridlayout-v7:21.0.0 271</pre> 272 273 274 275<h3 id="v7-mediarouter">v7 mediarouter library</h3> 276 277<p>This library provides {@link android.support.v7.media.MediaRouter}, {@link 278android.support.v7.media.MediaRouteProvider}, and related media classes that 279support <a href="https://developers.google.com/cast/docs/android_sender">Google Cast</a>. </p> 280 281<p>In general, the APIs in the v7 mediarouter library provide a means of 282controlling the routing of media channels and streams from the current device to 283external screens, speakers, and other destination devices. The library includes 284APIs for publishing app-specific media route providers, for discovering and 285selecting destination devices, for checking media status, and more. For detailed 286information about the v7 mediarouter library APIs, see the 287{@link android.support.v7.media android.support.v7.media} package in the API 288reference.</p> 289 290<p>The v7 mediarouter library is located in the 291<code><sdk>/extras/android/support/v7/mediarouter/</code> directory after 292you download the Android Support Library. It's provided as a library project 293with a dependency on the v7 appcompat library, so you'll need to include both 294libraries in your build path when setting up your project. For more information 295on how to set up your project, follow the instructions in <a 296href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries 297with resources</a>. If you are developing in Eclipse/ADT, make sure to include 298both the <code>android-support-v7-mediarouter.jar</code> and 299<code>android-support-v7-appcompat.jar</code> files.</p> 300 301<p>If you are using Android Studio, all you need to do is specify the Gradle build 302script dependency identifier <code>com.android.support:support-v7-mediarouter:<revision></code>, 303where "<revision>" is the minimum revision at which the library is available. For example:</p> 304 305<pre> 306com.android.support:mediarouter-v7:21.0.0 307</pre> 308 309<p class="caution">The v7 mediarouter library APIs introduced in Support Library 310r18 are subject to change in later revisions of the Support Library. At this 311time, we recommend using the library only in connection with <a 312href="https://developers.google.com/cast/docs/android_sender">Google Cast</a>. </p> 313 314<h3 id="v7-palette">v7 palette library</h3> 315 316<p>The v7 palette support library includes the 317{@link android.support.v7.graphics.Palette} class, which lets you extract 318prominent colors from an image. For example, a music app could use a 319{@link android.support.v7.graphics.Palette} object to extract the major colors 320from an album cover, and use those colors to build a color-coordinated song 321title card.</p> 322 323<p>This library is located in the 324{@code <sdk>/extras/android/support/v7/palette/} directory after 325 you download the Android Support Libraries. The library does not contain user interface 326 resources. To include it in your application project, follow the instructions for 327 <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without 328 resources</a>.</p> 329 330<p>The Gradle build script dependency identifier for this library is as follows:</p> 331 332<pre> 333com.android.support:palette-v7:21.0.0 334</pre> 335 336 337 338<h3 id="v7-recyclerview">v7 recyclerview library</h3> 339 340<p>The recyclerview library adds the {@link android.support.v7.widget.RecyclerView} 341class. This class provides support for the 342<a href="{@docRoot}training/material/lists-cards.jd#RecyclerView">RecyclerView 343widget</a>, a view for efficiently displaying large data sets by providing a 344limited window of data items.</p> 345 346<p>This library is located in the 347{@code <sdk>/extras/android/support/v7/recyclerview/} directory after you 348download the Android Support Libraries. The library contains user interface 349resources. To include it in your application project, follow the instructions 350for <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding 351libraries with resources</a>.</p> 352 353<p>The Gradle build script dependency identifier for this library is as follows:</p> 354 355<pre> 356com.android.support:recyclerview-v7:21.0.0 357</pre> 358 359 360 361<h2 id="v8">v8 Support Library</h2> 362 363<p>This library is designed to be used with Android (API level 8) and higher. It adds support for 364 the <a href="{@docRoot}guide/topics/renderscript/compute.html">RenderScript</a> computation 365 framework. These APIs are included in the {@link android.support.v8.renderscript} package. You 366 should be aware that the steps for including these APIs in your application is <em>very 367 different</em> from other support library APIs. For more information about using these APIs 368 in your application, see the 369 <a href="{@docRoot}guide/topics/renderscript/compute.html#access-rs-apis">RenderScript</a> 370 developer guide.</p> 371 372<p class="note"> 373 <strong>Note:</strong> Use of RenderScript with the support library is supported with the Android 374 Eclipse plugin and Ant build tools. It is <em>not currently</em> supported with Android Studio or 375 Gradle-based builds. 376</p> 377 378 379<h2 id="v13">v13 Support Library</h2> 380 381<p>This library is designed to be used for Android 3.2 (API level 13) and higher. It adds support 382 for the <a href="{@docRoot}guide/components/fragments.html">Fragment</a> user interface pattern 383 with the ({@link android.support.v13.app.FragmentCompat}) class and additional fragment support 384 classes. For more information about fragments, see the 385 <a href="{@docRoot}guide/components/fragments.html">Fragments</a> developer guide. For detailed 386 information about the v13 Support Library APIs, see the {@link android.support.v13.app 387 android.support.v13} package in the API reference. 388</p> 389 390<p>This library is located in the {@code <sdk>/extras/android/support/v13/} directory after 391 you download the Android Support Libraries. The library does not contain user interface 392 resources. To include it in your application project, follow the instructions for 393 <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without 394 resources</a>.</p> 395 396<p>The Gradle build script dependency identifier for this library is as follows:</p> 397 398<pre> 399com.android.support:support-v13:18.0.0 400</pre> 401 402 403 404<h2 id="v17-leanback">v17 Leanback Library</h2> 405 406<p>The {@link android.support.v17.leanback} package provides APIs to support 407 building user interfaces 408 on TV devices. It provides a number of important widgets for TV apps. Some of the notable classes include:</p> 409 410<ul> 411 <li>{@link android.support.v17.leanback.app.BrowseFragment} - A fragment for 412 creating a primary layout for browsing categories and rows of media 413 items.</li> 414 <li>{@link android.support.v17.leanback.app.DetailsFragment} - A wrapper 415 fragment for Leanback details screens.</li> 416 <li>{@link android.support.v17.leanback.app.PlaybackOverlayFragment} - A 417 subclass of {@link android.support.v17.leanback.app.DetailsFragment} for 418 displaying playback controls and related content.</li> 419 <li>{@link android.support.v17.leanback.app.SearchFragment} - A fragment to 420 handle searches. The fragment receives the user's search request and passes 421 it to the application-provided {@link 422 android.support.v17.leanback.app.SearchFragment.SearchResultProvider 423 SearchResultProvider}. The {@link 424 android.support.v17.leanback.app.SearchFragment.SearchResultProvider 425 SearchResultProvider} returns the search results to the 426 {@link android.support.v17.leanback.app.SearchFragment}, which renders them 427 into a {@link android.support.v17.leanback.app.RowsFragment}.</li> 428</ul> 429 430<p>This library is located in the 431{@code <sdk>/extras/android/support/v17/leanback} directory after 432you download the Android Support Libraries. For more information 433on how to set up your project, follow the instructions in <a 434href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries 435with resources</a>. </p> 436 437<p>The Gradle build script dependency identifier for this library is as follows:</p> 438 439<pre> 440com.android.support:leanback-v17:21.0.0 441</pre> 442 443 444 445