summaryrefslogtreecommitdiffstats
path: root/docs/html/sdk/installing/adding-packages.jd
blob: 58a806504b4f0455b93ffe33a6b0ab4f869ff0f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
page.title=Adding SDK Packages

page.tags=sdk manager
helpoutsWidget=true

@jd:body

<style>
ol.large {
  margin-left:0;
}
ol.large > li {
  list-style-position: inside;
  list-style-type:none;
  margin:30px 0 0 0;
  padding:30px 20px;
  background:#eee;
}
ol.large > li:nth-child(odd) {
}
ol.large > li:before {
  display:inline;
  left:-40px;
  float:left;
  width:20px;
  font-size:20px;
  line-height:20px;
}
ol.large > li > h2 {
  font-size:20px;
  line-height:20px;
  padding:0 0 0 20px;
  margin:0 0 20px 0;
  display:inline-block;
  font-weight:normal;
}
ol.large > li:nth-child(1):before {
  content:"1. ";
}
ol.large > li:nth-child(2):before {
  content:"2. ";
}
ol.large > li:nth-child(3):before {
  content:"3. ";
}
ol.large > li:nth-child(4):before {
  content:"4. ";
}
ol.large > li:nth-child(5):before {
  content:"5. ";
}
ol.large > li:nth-child(6):before {
  content:"6. ";
}
</style>


<p>
By default, the Android SDK does not include everything you need to start developing.
The SDK separates tools, platforms, and other components into packages you can
download as needed using the
<a href="{@docRoot}tools/help/sdk-manager.html">Android SDK Manager</a>.
So before you can start, there are a few packages you should add to your Android SDK.</p>

<p>To start adding packages, launch the Android SDK Manager in one of the following ways:</p>
<ul>
  <li>In Eclipse or Android Studio, click <strong>SDK Manager</strong>
<img src="{@docRoot}images/tools/sdk-manager-studio.png"
style="vertical-align:bottom;margin:0;height:17px" /> in the toolbar.</li>
  <li>If you're not using Eclipse or Android Studio:
    <ul>
      <li>Windows: Double-click the <code>SDK Manager.exe</code> file at the root of the Android
  SDK directory.</li>
      <li>Mac/Linux: Open a terminal and navigate to the <code>tools/</code> directory in the
      location where the Android SDK was installed, then execute <code>android sdk</code>.</li>
    </ul>
  </li>
</ul>

<p>When you open the SDK Manager for the first time, several packages will be selected by
default. Leave these selected, but be sure you have everything you need
to get started by following these steps:</p>


<ol class="large">
<li>
  <h2 id="GetTools" class="norule">Get the latest SDK tools</h2>

<img src="/images/sdk_manager_packages.png" alt="" width="350" style="float:right;margin-left:20px" />

  <p>As a minimum when setting up the Android SDK,
  you should download the latest tools and Android platform:</p>
  <ol>
   <li>Open the Tools directory and select:
     <ul>
       <li><strong>Android SDK Tools</strong></li>
       <li><strong>Android SDK Platform-tools</strong></li>
       <li><strong>Android SDK Build-tools</strong> (highest version)</li>
     </ul>
   </li>
   <li>Open the first Android X.X folder (the latest version) and select:
     <ul>
      <li><strong>SDK Platform</strong></li>
      <li>A system image for the emulator, such as <br>
      <strong>ARM EABI v7a System Image</strong></li>
     </ul>
   </li>
  </ol>
</li>

<li>
  <h2 id="GetSupportLib" class="norule">Get the support library for additional APIs</h2>

  <div class="sidebox">
    <p>The support library is required for:</p>
    <ul>
      <li><a href="{@docRoot}wear/index.html">Android Wear</a></li>
      <li><a href="{@docRoot}tv/index.html">Android TV</a></li>
      <li><a href="{@docRoot}google/play-services/cast.html">Google Cast</a></li>
    </ul>

    <p>It also provides these popular APIs:</p>
    <ul>
      <li><a href="{@docRoot}reference/android/support/v4/widget/DrawerLayout.html">Navigation
      drawer</a></li>
      <li><a href="{@docRoot}reference/android/support/v4/view/ViewPager.html">Swipe views</a></li>
      <li><a href="{@docRoot}reference/android/support/v7/app/ActionBar.html">Backward-compatible
      action bar</a></li>
    </ul>
  </div>

  <p>The <a href="{@docRoot}tools/support-library/features.html">Android Support Library</a>
  provides an extended set of APIs that are compatible with most versions of Android.</p>

  <p>Open the <strong>Extras</strong> directory and select:</p>
     <ul>
       <li><strong>Android Support Repository</strong></li>
       <li><strong>Android Support Library</strong></li>
     </ul>

  <p>&nbsp;</p>
  <p>&nbsp;</p>

</li>


<li>
  <h2 id="GetGoogle" class="norule">Get Google Play services for even more APIs</h2>

  <div class="sidebox">

    <p>The Google Play services APIs provide a variety of features and services for your Android
    apps, such as:</p>
    <ul>
      <li><a href="{@docRoot}google/play-services/plus.html">User authentication</a></li>
      <li><a href="{@docRoot}google/play-services/maps.html">Google Maps</a></li>
      <li><a href="{@docRoot}google/play-services/cast.html">Google Cast</a></li>
      <li><a href="{@docRoot}google/play-services/games.html">Games achievements and
      leaderboards</a></li>
      <li><a href="{@docRoot}google/play-services/index.html">And much more</a></li>
    </ul>
  </div>

  <p>To develop with Google APIs, you need the Google Play services package:</p>
  <p>Open the <strong>Extras</strong> directory and select:</p>
     <ul>
       <li><strong>Google Repository</strong></li>
       <li><strong>Google Play services</strong></li>
     </ul>

  <p class="note"><strong>Note:</strong> Google Play services APIs are not available on all
  Android-powered devices, but are available on all devices with Google Play Store. To use these
  APIs in the Android emulator, you must also install the the <strong>Google APIs</strong>
  system image from the latest Android X.X directory in the SDK Manager.</p>
</li>


<li>
  <h2 id="Install" class="norule">Install the packages</h2>
  <p>Once you've selected all the desired packages, continue to install:</p>
  <ol>
   <li>Click <strong>Install X packages</strong>.</li>
   <li>In the next window, double-click each package name on the left
   to accept the license agreement for each.</li>
   <li>Click <strong>Install</strong>.</li>
  </ol>
  <p>The download progress is shown at the bottom of the SDK Manager window.
  <strong>Do not exit the SDK Manager</strong> or it will cancel the download.</p>
</li>

<li>
  <h2 id="Build" class="norule">Build something!</h2>

<p>With the above packages now in your Android SDK, you're ready to build apps
for Android. As new tools and other APIs become available, simply launch the SDK Manager
  to download the new packages for your SDK.</p>

<p>Here are a few options for how you should proceed:</p>

<div class="cols" style="padding:10px 0">
<div class="col-4">
<h3>Get started</h3>
<p>If you're new to Android development, learn the basics of Android apps by following
the guide to <strong><a href="{@docRoot}training/basics/firstapp/index.html"
>Building Your First App</a></strong>.</p>

</div>
<div class="col-4 box">
<h3>Build for wearables</h3>
<p>If you're ready to start building apps for Android wearables, see the guide to
<strong><a href="{@docRoot}wear/preview/start.html">Building Apps for Android Wear</a></strong>.</p>

</div>
<div class="col-4 box">
<h3>Use Google APIs</h3>
<p>To start using Google APIs, such as Maps or
Play Game services, see the guide to
<strong><a href="{@docRoot}google/play-services/setup.html">Setting Up Google Play
Services</a></strong>.</p>

</div>
</div><!-- end cols -->


</li>

</ol>