Home | History | Annotate | Download | only in installing
      1 page.title=Adding SDK Packages
      2 
      3 @jd:body
      4 
      5 <style>
      6 ol.large {
      7   margin-left:0;
      8 }
      9 ol.large > li {
     10   list-style-position: inside;
     11   list-style-type:none;
     12   margin:30px 0 0 0;
     13   padding:30px 20px;
     14   background:#eee;
     15 }
     16 ol.large > li:nth-child(odd) {
     17 }
     18 ol.large > li:before {
     19   display:inline;
     20   left:-40px;
     21   float:left;
     22   width:20px;
     23   font-size:20px;
     24   line-height:20px;
     25 }
     26 ol.large > li > h2 {
     27   font-size:20px;
     28   line-height:20px;
     29   padding:0 0 0 20px;
     30   margin:0 0 20px 0;
     31   display:inline-block;
     32   font-weight:normal;
     33 }
     34 ol.large > li:nth-child(1):before {
     35   content:"1. ";
     36 }
     37 ol.large > li:nth-child(2):before {
     38   content:"2. ";
     39 }
     40 ol.large > li:nth-child(3):before {
     41   content:"3. ";
     42 }
     43 ol.large > li:nth-child(4):before {
     44   content:"4. ";
     45 }
     46 ol.large > li:nth-child(5):before {
     47   content:"5. ";
     48 }
     49 ol.large > li:nth-child(6):before {
     50   content:"6. ";
     51 }
     52 </style>
     53 
     54 
     55 <p>
     56 By default, the Android SDK does not include everything you need to start developing.
     57 The SDK separates tools, platforms, and other components into packages you can
     58 download as needed using the
     59 <a href="{@docRoot}tools/help/sdk-manager.html">Android SDK Manager</a>.
     60 So before you can start, there are a few packages you should add to your Android SDK.</p>
     61 
     62 <p>To start adding packages, launch the Android SDK Manager in one of the following ways:</p>
     63 <ul>
     64   <li>In Eclipse or Android Studio, click <strong>SDK Manager</strong>
     65 <img src="{@docRoot}images/tools/sdk-manager-studio.png"
     66 style="vertical-align:bottom;margin:0;height:17px" /> in the toolbar.</li>
     67   <li>If you're not using Eclipse or Android Studio:
     68     <ul>
     69       <li>Windows: Double-click the <code>SDK Manager.exe</code> file at the root of the Android
     70   SDK directory.</li>
     71       <li>Mac/Linux: Open a terminal and navigate to the <code>tools/</code> directory in the
     72   Android SDK, then execute <code>android sdk</code>.</li>
     73     </ul>
     74   </li>
     75 </ul>
     76 
     77 <p>When you open the SDK Manager for the first time, several packages will be selected by
     78 default. Leave these selected, but be sure you have everything you need
     79 to get started by following these steps:</p>
     80 
     81 
     82 <ol class="large">
     83 <li>
     84   <h2 id="GetTools" class="norule">Get the latest SDK tools</h2>
     85 
     86 <img src="/images/sdk_manager_packages.png" alt="" width="350" style="float:right;margin-left:20px" />
     87 
     88   <p>As a minimum when setting up the Android SDK,
     89   you should download the latest tools and Android platform:</p>
     90   <ol>
     91    <li>Open the Tools directory and select:
     92      <ul>
     93        <li><strong>Android SDK Tools</strong></li>
     94        <li><strong>Android SDK Platform-tools</strong></li>
     95        <li><strong>Android SDK Build-tools</strong> (highest version)</li>
     96      </ul>
     97    </li>
     98    <li>Open the first Android X.X folder (the latest version) and select:
     99      <ul>
    100       <li><strong>SDK Platform</strong></li>
    101       <li>A system image for the emulator, such as <br>
    102       <strong>ARM EABI v7a System Image</strong></li>
    103      </ul>
    104    </li>
    105   </ol>
    106 </li>
    107 
    108 <li>
    109   <h2 id="GetSupportLib" class="norule">Get the support library for additional APIs</h2>
    110 
    111   <div class="sidebox">
    112     <p>The support library is required for:</p>
    113     <ul>
    114       <li><a href="{@docRoot}wear/index.html">Android Wear</a></li>
    115       <li><a href="{@docRoot}tv/index.html">Android TV</a></li>
    116       <li><a href="{@docRoot}google/play-services/cast.html">Google Cast</a></li>
    117     </ul>
    118 
    119     <p>It also provides these popular APIs:</p>
    120     <ul>
    121       <li><a href="{@docRoot}reference/android/support/v4/widget/DrawerLayout.html">Navigation
    122       drawer</a></li>
    123       <li><a href="{@docRoot}reference/android/support/v4/view/ViewPager.html">Swipe views</a></li>
    124       <li><a href="{@docRoot}reference/android/support/v7/app/ActionBar.html">Backward-compatible
    125       action bar</a></li>
    126     </ul>
    127   </div>
    128 
    129   <p>The <a href="{@docRoot}tools/support-library/features.html">Android Support Library</a>
    130   provides an extended set of APIs that are compatible with most versions of Android.</p>
    131 
    132   <p>Open the <strong>Extras</strong> directory and select:</p>
    133      <ul>
    134        <li><strong>Android Support Repository</strong></li>
    135        <li><strong>Android Support Library</strong></li>
    136      </ul>
    137 
    138   <p>&nbsp;</p>
    139   <p>&nbsp;</p>
    140 
    141 </li>
    142 
    143 
    144 <li>
    145   <h2 id="GetGoogle" class="norule">Get Google Play services for even more APIs</h2>
    146 
    147   <div class="sidebox">
    148 
    149     <p>The Google Play services APIs provide a variety of features and services for your Android
    150     apps, such as:</p>
    151     <ul>
    152       <li><a href="{@docRoot}google/play-services/plus.html">User authentication</a></li>
    153       <li><a href="{@docRoot}google/play-services/maps.html">Google Maps</a></li>
    154       <li><a href="{@docRoot}google/play-services/cast.html">Google Cast</a></li>
    155       <li><a href="{@docRoot}google/play-services/games.html">Games achievements and
    156       leaderboards</a></li>
    157       <li><a href="{@docRoot}google/play-services/index.html">And much more</a></li>
    158     </ul>
    159   </div>
    160 
    161   <p>To develop with Google APIs, you need the Google Play services package:</p>
    162   <p>Open the <strong>Extras</strong> directory and select:</p>
    163      <ul>
    164        <li><strong>Google Repository</strong></li>
    165        <li><strong>Google Play services</strong></li>
    166      </ul>
    167 
    168   <p class="note"><strong>Note:</strong> Google Play services APIs are not available on all
    169   Android-powered devices, but are available on all devices with Google Play Store. To use these
    170   APIs in the Android emulator, you must also install the the <strong>Google APIs</strong>
    171   system image from the latest Android X.X directory in the SDK Manager.</p>
    172 </li>
    173 
    174 
    175 <li>
    176   <h2 id="Install" class="norule">Install the packages</h2>
    177   <p>Once you've selected all the desired packages, continue to install:</p>
    178   <ol>
    179    <li>Click <strong>Install X packages</strong>.</li>
    180    <li>In the next window, double-click each package name on the left
    181    to accept the license agreement for each.</li>
    182    <li>Click <strong>Install</strong>.</li>
    183   </ol>
    184   <p>The download progress is shown at the bottom of the SDK Manager window.
    185   <strong>Do not exit the SDK Manager</strong> or it will cancel the download.</p>
    186 </li>
    187 
    188 <li>
    189   <h2 id="Build" class="norule">Build something!</h2>
    190 
    191 <p>With the above packages now in your Android SDK, you're ready to build apps
    192 for Android. As new tools and other APIs become available, simply launch the SDK Manager
    193   to download the new packages for your SDK.</p>
    194 
    195 <p>Here are a few options for how you should proceed:</p>
    196 
    197 <div class="cols" style="padding:10px 0">
    198 <div class="col-4">
    199 <h3>Get started</h3>
    200 <p>If you're new to Android development, learn the basics of Android apps by following
    201 the guide to <strong><a href="{@docRoot}training/basics/firstapp/index.html"
    202 >Building Your First App</a></strong>.</p>
    203 
    204 </div>
    205 <div class="col-4 box">
    206 <h3>Build for wearables</h3>
    207 <p>If you're ready to start building apps for Android wearables, see the guide to
    208 <strong><a href="{@docRoot}wear/preview/start.html">Building Apps for Android Wear</a></strong>.</p>
    209 
    210 </div>
    211 <div class="col-4 box">
    212 <h3>Use Google APIs</h3>
    213 <p>To start using Google APIs, such as Maps or
    214 Play Game services, see the guide to
    215 <strong><a href="{@docRoot}google/play-services/setup.html">Setting Up Google Play
    216 Services</a></strong>.</p>
    217 
    218 </div>
    219 </div><!-- end cols -->
    220 
    221 
    222 </li>
    223 
    224 </ol>
    225 
    226 
    227