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