Home | History | Annotate | Download | only in support-library
      1 page.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="#v7">v7 Libraries</a>
     12         <ol>
     13           <li><a href="#v7-appcompat">v7 appcompat library</a></li>
     14           <li><a href="#v7-gridlayout">v7 gridlayout library</a></li>
     15           <li><a href="#v7-mediarouter">v7 mediarouter library</a></li>
     16         </ol>
     17       </li>
     18       <li><a href="#v8">v8 Support Library</a></li>
     19       <li><a href="#v13">v13 Support Library</a></li>
     20     </ol>
     21 
     22     <h2>See also</h2>
     23     <ol>
     24       <li><a href="{@docRoot}tools/support-library/index.html#revisions">
     25         Support Library Revisions</a></li>
     26       <li><a href="{@docRoot}tools/support-library/setup.html">
     27         Support Library Setup</a></li>
     28     </ol>
     29 
     30   </div>
     31 </div>
     32 
     33 <p>The Android Support Library package contains several libraries that can be included
     34   in your application. Each of these libraries supports a specific range of Android platform
     35   versions and set of features.</p>
     36 
     37 <p>This guide explains the important features and version support provided by the Support
     38   Libraries to help you decide which of them you should include in your application. In general,
     39   we recommend including the <a href="#v4">v4 support</a> and <a href="#v7-appcompat">v7
     40   appcompat</a> libraries, because they support a wide range of
     41   Android versions and provide APIs for recommended user interface patterns.</p>
     42 
     43 <p>In order to use any of the following libraries, you must download the library files to your
     44   Android SDK installation. Follow the directions for downloading the Support Libraries in
     45   <a href="{@docRoot}tools/support-library/setup.html#download">Support Library Setup</a> to
     46   complete this step. You must take additional steps to include a specific Support Library in
     47   your application. See the end of each library section below for important information on how to
     48   include the library in your application.</p>
     49 
     50 
     51 <h2 id="v4">v4 Support Library</h2>
     52 
     53 <p>This library is designed to be used with Android 1.6 (API level 4) and higher. It includes the
     54   largest set of APIs compared to the other libraries, including support for application components,
     55   user interface features, accessibility, data handling, network connectivity, and programming
     56   utilities. Here are a few of the key classes included in the v4 library:</p>
     57 
     58 <ul>
     59   <li>App Components
     60     <ul>
     61       <li>{@link android.support.v4.app.Fragment}
     62         - Adds support encapsulation of user interface and functionality with Fragments, enabling
     63         applications provide layouts that adjust between small and large-screen devices.</li>
     64     </ul>
     65     <ul>
     66       <li>{@link android.support.v4.app.NotificationCompat} - Adds support for rich notification
     67         features.</li>
     68     </ul>
     69     <ul>
     70       <li>{@link android.support.v4.content.LocalBroadcastManager} - Allows applications to easily
     71         register for and receive intents within a single application without broadcasting them
     72         globally.</li>
     73     </ul>
     74   </li>
     75   <li>User Interface
     76     <ul>
     77       <li>{@link android.support.v4.view.ViewPager} - Adds a
     78       {@link android.view.ViewGroup} that manages the layout for the
     79       child views, which the user can swipe between.</li>
     80       <li>{@link android.support.v4.view.PagerTitleStrip}
     81         - Adds a non-interactive title strip, that can be added as a child of
     82         {@link android.support.v4.view.ViewPager}.</li>
     83       <li>{@link android.support.v4.view.PagerTabStrip} - Adds a
     84         navigation widget for switching between paged views, that can also be used with
     85         {@link android.support.v4.view.ViewPager}.</li>
     86       <li>{@link android.support.v4.widget.DrawerLayout} - Adds
     87       support for creating a <a href="{@docRoot}training/implementing-navigation/nav-drawer.html"
     88       >Navigation Drawer</a> that can be pulled in from the edge of a window.</li>
     89       <li>{@link android.support.v4.widget.SlidingPaneLayout}
     90         - Adds widget for creating linked summary and detail views that
     91         appropriately adapt to various screen sizes.</li>
     92     </ul>
     93   </li>
     94   <li>Accessibility
     95     <ul>
     96       <li>{@link android.support.v4.widget.ExploreByTouchHelper}
     97         - Adds a helper class for implementing accessibility support for custom views.</li>
     98     </ul>
     99     <ul>
    100       <li>{@link android.support.v4.view.accessibility.AccessibilityEventCompat} - Adds support for
    101       {@link android.view.accessibility.AccessibilityEvent}. For more information about implementing
    102       accessibility, see <a href="{@docRoot}guide/topics/ui/accessibility/index.html"
    103       >Accessibility</a>.</li>
    104     </ul>
    105     <ul>
    106       <li>{@link android.support.v4.view.accessibility.AccessibilityNodeInfoCompat} - Adds support
    107       for {@link android.view.accessibility.AccessibilityNodeInfo}.</li>
    108     </ul>
    109     <ul>
    110       <li>{@link android.support.v4.view.accessibility.AccessibilityNodeProviderCompat} - Adds
    111       support for {@link android.view.accessibility.AccessibilityNodeProvider}.</li>
    112     </ul>
    113     <ul>
    114       <li>{@link android.support.v4.view.AccessibilityDelegateCompat} - Adds support for
    115       {@link android.view.View.AccessibilityDelegate}.</li>
    116     </ul>
    117   </li>
    118   <li>Content
    119     <ul>
    120       <li>{@link android.support.v4.content.Loader} - Adds support for asynchronous loading of data.
    121         The library also provides concrete implementations of this class, including
    122         {@link android.support.v4.content.CursorLoader} and
    123         {@link android.support.v4.content.AsyncTaskLoader}.</li>
    124     </ul>
    125     <ul>
    126       <li>{@link android.support.v4.content.FileProvider} - Adds support for sharing of private
    127         files between applications.</li>
    128     </ul>
    129   </li>
    130 </ul>
    131 
    132 <p>
    133   There are many other APIs included in this library. For complete, detailed information about the
    134   v4 Support Library APIs, see the {@link android.support.v4.app android.support.v4} package in the
    135   API reference.
    136 </p>
    137 
    138 <p>This library is located in the {@code &lt;sdk&gt;/extras/android/support/v4/} directory after
    139   you download the Android Support Libraries. This library does not contain user interface
    140   resources. To include it in your application project, follow the instructions for
    141   <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">adding libraries without
    142   resources</a>.</p>
    143 
    144 <p>The Gradle build script dependency identifier for this library is as follows:</p>
    145 
    146 <pre>
    147 com.android.support:support-v4:18.0.+
    148 </pre>
    149 
    150 <p>This dependency notation specifies the release version 18.0.0 or higher.</p>
    151 
    152 
    153 <h2 id="v7">v7 Libraries</h2>
    154 
    155 <p>There are several libraries designed to be used with Android 2.1 (API level 7) and higher.
    156   These libraries provide specific feature sets and can be included in your application
    157   independently from each other.</p>
    158 
    159 
    160 <h3 id="v7-appcompat">v7 appcompat library</h3>
    161 
    162 <p>This library adds support for the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action
    163   Bar</a> user interface <a href="{@docRoot}design/patterns/actionbar.html">design pattern</a>.
    164 </p>
    165 
    166 <p class="note"><strong>Note:</strong>
    167   This library depends on the v4 Support Library. If you are using Ant or Eclipse, make sure
    168   you include the v4 Support Library as part of this library's classpath.
    169 </p>
    170 
    171 <p>Here are a few of the key classes included in the v7 appcompat library:</p>
    172 
    173 <ul>
    174   <li>{@link android.support.v7.app.ActionBar} - Provides an implementation of the action bar
    175       <a href="{@docRoot}design/patterns/actionbar.html">user interface pattern</a>. For more
    176       information on using the Action Bar, see the
    177       <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guide.
    178   </li>
    179   <li>{@link android.support.v7.app.ActionBarActivity} - Adds an application activity class that
    180       must be used as a base class for activities that uses the Support Library action bar
    181       implementation.
    182   </li>
    183   <li>{@link android.support.v7.widget.ShareActionProvider} - Adds support for a standardized
    184     sharing action (such as email or posting to social applications) that can be included in an
    185     action bar.
    186   </li>
    187 </ul>
    188 
    189 <p>This library is located in the {@code &lt;sdk&gt;/extras/android/support/v7/appcompat/}
    190   directory after you download the Android Support Libraries. This library contains user
    191   interface resources. To include it in your application project, follow the instructions for
    192   <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">adding libraries with
    193   resources</a>.</p>
    194 
    195 <p>The Gradle build script dependency identifier for this library is as follows:</p>
    196 
    197 <pre>
    198 com.android.support:appcompat-v7:18.0.+
    199 </pre>
    200 
    201 <p>This dependency notation specifies the release version 18.0.0 or higher.</p>
    202 
    203 <h3 id="v7-gridlayout">v7 gridlayout library</h3>
    204 
    205 <p>This library adds support for the {@link android.support.v7.widget.GridLayout} class, which
    206   allows you to arrange user interface elements using a grid of rectangular cells.
    207   For detailed information about the v7 gridlayout library APIs, see the
    208   {@link android.support.v7.widget android.support.v7.widget} package in the API reference.</p>
    209 
    210 <p>This library is located in the {@code &lt;sdk&gt;/extras/android/support/v7/gridlayout/}
    211   directory after you download the Android Support Libraries. This library contains user
    212   interface resources. To include it in your application project, follow the instructions for
    213   <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">adding libraries with
    214   resources</a>.</p>
    215 
    216 <p>The Gradle build script dependency identifier for this library is as follows:</p>
    217 
    218 <pre>
    219 com.android.support:gridlayout-v7:18.0.+
    220 </pre>
    221 
    222 <p>This dependency notation specifies the release version 18.0.0 or higher.</p>
    223 
    224 <h3 id="v7-mediarouter">v7 mediarouter library</h3>
    225 
    226 <p>This library provides {@link android.support.v7.media.MediaRouter}, {@link
    227 android.support.v7.media.MediaRouteProvider}, and related media classes that
    228 support the <a href="https://developers.google.com/cast/">Google Cast
    229 developer preview</a>. </p>
    230 
    231 <p>In general, the APIs in the v7 mediarouter library provide a means of
    232 controlling the routing of media channels and streams from the current device to
    233 external screens, speakers, and other destination devices. The library includes
    234 APIs for publishing app-specific media route providers, for discovering and
    235 selecting destination devices, for checking media status, and more. For detailed
    236 information about the v7 mediarouter library APIs, see the
    237 {@link android.support.v7.media android.support.v7.media} package in the API
    238 reference.</p>
    239 
    240 <p>The v7 mediarouter library is located in the
    241 <code>&lt;sdk&gt;/extras/android/support/v7/mediarouter/</code> directory after
    242 you download the Android Support Library. It's provided as a library project
    243 with a dependency on the v7 appcompat library, so you'll need to include both
    244 libraries in your build path when setting up your project. For more information
    245 on how to set up your project, follow the instructions in <a
    246 href="{@docRoot}tools/support-library/setup.html#libs-with-res">adding libraries
    247 with resources</a>. If you are developing in Eclipse/ADT, make sure to include
    248 both the <code>android-support-v7-mediarouter.jar</code> and
    249 <code>android-support-v7-appcompat.jar</code> files.</p>
    250 
    251 <p>If you are using Android Studio, all you need to do is specify the Gradle build
    252 script dependency identifier <code>com.android.support:support-v7-mediarouter:&lt;revision&gt;</code>,
    253 where "18.0.0" is the minimum revision at which the library is available. For example:</p>
    254 
    255 <pre>
    256 com.android.support:mediarouter-v7:18.0.+
    257 </pre>
    258 
    259 <p class="caution">The v7 mediarouter library APIs introduced in Support Library
    260 r18 are subject to change in later revisions of the Support Library. At this
    261 time, we recommend using the library only in connection with the <a
    262 href="https://developers.google.com/cast/">Google Cast
    263 developer preview</a>. </p>
    264 
    265 
    266 <h2 id="v8">v8 Support Library</h2>
    267 
    268 <p>This library is designed to be used with Android (API level 8) and higher. It adds support for
    269   the <a href="{@docRoot}guide/topics/renderscript/compute.html">RenderScript</a> computation
    270   framework. These APIs are included in the {@link android.support.v8.renderscript} package. You
    271   should be aware that the steps for including these APIs in your application is <em>very
    272   different</em> from other support library APIs. For more information about using these APIs
    273   in your application, see the
    274   <a href="{@docRoot}guide/topics/renderscript/compute.html#access-rs-apis">RenderScript</a>
    275   developer guide.</p>
    276 
    277 <p class="note">
    278   <strong>Note:</strong> Use of RenderScript with the support library is supported with the Android
    279   Eclipse plugin and Ant build tools. It is <em>not currently</em> supported with Android Studio or
    280   Gradle-based builds.
    281 </p>
    282 
    283 
    284 <h2 id="v13">v13 Support Library</h2>
    285 
    286 <p>This library is designed to be used for Android 3.2 (API level 13) and higher. It adds support
    287   for the <a href="{@docRoot}guide/components/fragments.html">Fragment</a> user interface pattern
    288   with the ({@link android.support.v13.app.FragmentCompat}) class and additional fragment support
    289   classes For more information about fragments, see the
    290   <a href="{@docRoot}guide/components/fragments.html">Fragments</a> developer guide. For detailed
    291   information about the v13 Support Library APIs, see the {@link android.support.v13.app
    292   android.support.v13} package in the API reference.
    293 </p>
    294 
    295 <p>This library is located in the {@code &lt;sdk&gt;/extras/android/support/v13/} directory after
    296   you download the Android Support Libraries. This library does not contain user interface
    297   resources. To include it in your application project, follow the instructions for
    298   <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">adding libraries without
    299   resources</a>.</p>
    300 
    301 <p>The Gradle build script dependency identifier for this library is as follows:</p>
    302 
    303 <pre>
    304 com.android.support:support-v13:18.0.+
    305 </pre>
    306 
    307 <p>This dependency notation specifies the release version 18.0.0 or higher.</p>
    308