sdkpage.cs revision c607a4d4d5f303d3ff139d752ccd69a7b2567aea
1<?cs include:"doctype.cs" ?>
2<?cs include:"macros.cs" ?>
3<?cs include:"../../../../frameworks/base/docs/html/sdk/sdk_vars.cs" ?>
4<html<?cs if:devsite ?> devsite<?cs /if ?>>
5<?cs if:sdk.redirect ?>
6  <head>
7    <title>Redirecting...</title>
8    <meta http-equiv="refresh" content="0;url=<?cs var:toroot ?>sdk/<?cs
9      if:sdk.redirect.path ?><?cs var:sdk.redirect.path ?><?cs
10      else ?>index.html<?cs /if ?>">
11  </head>
12<?cs else ?>
13  <?cs include:"head_tag.cs" ?>
14<?cs /if ?>
15<body class="gc-documentation
16  <?cs if:(guide||develop||training||reference||tools||sdk) ?>develop<?cs
17  elif:design ?>design<?cs
18  elif:distribute ?>distribute<?cs
19  /if ?>" itemscope itemtype="http://schema.org/CreativeWork">
20  <a name="top"></a>
21<?cs include:"header.cs" ?>
22
23
24<div <?cs if:fullpage
25?><?cs else
26?>class="col-13" id="doc-col"<?cs /if ?> >
27
28<?cs if:sdk.redirect ?>
29
30<div class="g-unit">
31  <div id="jd-content">
32    <p>Redirecting to
33    <a href="<?cs var:toroot ?>sdk/<?cs
34      if:sdk.redirect.path ?><?cs var:sdk.redirect.path ?><?cs
35      else ?>index.html<?cs /if ?>"><?cs
36      if:sdk.redirect.path ?><?cs var:sdk.redirect.path ?><?cs
37      else ?>Download the SDK<?cs /if ?>
38    </a> ...</p>
39
40<?cs else ?>
41<?cs # else, if NOT redirect ...
42#
43#
44# The following is for SDK/NDK pages
45#
46#
47?>
48
49<?cs if:header.hide ?><?cs else ?>
50<h1 itemprop="name"><?cs var:page.title ?></h1>
51<?cs /if ?>
52  <div id="jd-content" itemprop="description">
53
54<?cs if:sdk.not_latest_version ?>
55  <div class="special">
56    <p><strong>This is NOT the current Android SDK release.</strong></p>
57    <p><a href="/sdk/index.html">Download the current Android SDK</a></p>
58  </div>
59<?cs /if ?>
60
61
62<?cs if:ndk ?>
63<?cs #
64#
65#
66#
67#
68#
69#
70# the following is for the NDK
71#
72# (nested in if/else redirect)
73#
74#
75#
76#
77?>
78
79  <table class="download" id="download-table">
80    <tr>
81      <th>Platform</th>
82      <th>Package</th>
83      <th style="white-space:nowrap">Size (Bytes)</th>
84      <th>SHA1 Checksum</th>
85  </tr>
86  <tr>
87    <td>Windows 32-bit</td>
88    <td>
89  <a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
90     href="http://dl.google.com/android/repository/<?cs var:ndk.win32_download ?>"><?cs var:ndk.win32_download ?></a>
91    </td>
92    <td><?cs var:ndk.win32_bytes ?></td>
93    <td><?cs var:ndk.win32_checksum ?></td>
94  </tr>
95 <!-- <tr>
96   <td>
97  <a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
98     href="http://dl.google.com/android/ndk/<?cs var:ndk.win32.legacy_download ?>"><?cs var:ndk.win32.legacy_download ?></a>
99    </td>
100    <td><?cs var:ndk.win32.legacy_bytes ?></td>
101    <td><?cs var:ndk.win32.legacy_checksum ?></td>
102  </tr> -->
103  <tr>
104    <td>Windows 64-bit</td>
105    <td>
106  <a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
107     href="http://dl.google.com/android/repository/<?cs var:ndk.win64_download ?>"><?cs var:ndk.win64_download ?></a>
108    </td>
109    <td><?cs var:ndk.win64_bytes ?></td>
110    <td><?cs var:ndk.win64_checksum ?></td>
111  </tr>
112 <!--  <tr>
113    <td>
114  <a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
115     href="http://dl.google.com/android/repository/<?cs var:ndk.win64.legacy_download ?>"><?cs var:ndk.win64.legacy_download ?></a>
116    </td>
117    <td><?cs var:ndk.win64.legacy_bytes ?></td>
118    <td><?cs var:ndk.win64.legacy_checksum ?></td>
119  </tr> -->
120<!--   (this item is deprecated)
121  <tr>
122    <td>Mac OS X 32-bit</td>
123    <td>
124  <a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
125     href="http://dl.google.com/android/repository/<?cs var:ndk.mac32_download ?>"><?cs var:ndk.mac32_download ?></a>
126    </td>
127    <td><?cs var:ndk.mac32_bytes ?></td>
128    <td><?cs var:ndk.mac32_checksum ?></td>
129  </tr> -->
130 <!-- (this item is deprecated)
131  <tr>
132    <td>
133  <a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
134     href="http://dl.google.com/android/repository/<?cs var:ndk.mac32.legacy_download ?>"><?cs var:ndk.mac32.legacy_download ?></a>
135    </td>
136    <td><?cs var:ndk.mac32.legacy_bytes ?></td>
137    <td><?cs var:ndk.mac32.legacy_checksum ?></td>
138  </tr> -->
139    <td>Mac OS X 64-bit</td>
140    <td>
141  <a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
142     href="http://dl.google.com/android/repository/<?cs var:ndk.mac64_download ?>"><?cs var:ndk.mac64_download ?></a>
143    </td>
144    <td><?cs var:ndk.mac64_bytes ?></td>
145    <td><?cs var:ndk.mac64_checksum ?></td>
146  </tr>
147 <!--  <tr>
148    <td>
149  <a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
150     href="http://dl.google.com/android/repository/<?cs var:ndk.mac64.legacy_download ?>"><?cs var:ndk.mac64.legacy_download ?></a>
151    </td>
152    <td><?cs var:ndk.mac64.legacy_bytes ?></td>
153    <td><?cs var:ndk.mac64.legacy_checksum ?></td>
154  </tr> -->
155 <!--  <tr>
156    <td>
157  <a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
158     href="http://dl.google.com/android/repository/<?cs var:ndk.linux32.legacy_download ?>"><?cs var:ndk.linux32.legacy_download ?></a>
159    </td>
160    <td><?cs var:ndk.linux32.legacy_bytes ?></td>
161    <td><?cs var:ndk.linux32.legacy_checksum ?></td>
162  </tr> -->
163  <tr>
164    <td>Linux 64-bit (x86)</td>
165    <td>
166  <a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
167     href="http://dl.google.com/android/repository/<?cs var:ndk.linux64_download ?>"><?cs var:ndk.linux64_download ?></a>
168    </td>
169    <td><?cs var:ndk.linux64_bytes ?></td>
170    <td><?cs var:ndk.linux64_checksum ?></td>
171  </tr>
172  <!--  <tr>
173    <td>
174  <a onClick="return onDownload(this)" data-modal-toggle="ndk_tos"
175     href="http://dl.google.com/android/repository/<?cs var:ndk.linux64.legacy_download ?>"><?cs var:ndk.linux64.legacy_download ?></a>
176    </td>
177    <td><?cs var:ndk.linux64.legacy_bytes ?></td>
178    <td><?cs var:ndk.linux64.legacy_checksum ?></td>
179  </tr> -->
180
181  </table>
182
183  <?cs ########  HERE IS THE JD DOC CONTENT ######### ?>
184  <?cs call:tag_list(root.descr) ?>
185
186
187<?cs ########  The NDK version of the download script ######### ?>
188<script>
189  function onDownload(link) {
190
191    $("#downloadForRealz").html("Download " + $(link).text());
192    $("#downloadForRealz").attr('href',$(link).attr('href'));
193
194    return false;
195  }
196
197
198  function onAgreeChecked() {
199    if ($("input#agree").is(":checked")) {
200      $("a#downloadForRealz").removeClass('disabled');
201    } else {
202      $("a#downloadForRealz").addClass('disabled');
203    }
204  }
205
206
207  function onDownloadForRealz(link) {
208    if ($("input#agree").is(':checked')) {
209      $("div.sdk-terms").slideUp();
210      $("h2#tos-header").text('Now downloading...');
211      $(".sdk-terms-intro").text('Your download is in progress.');
212      $("#sdk-terms-form").fadeOut('slow', function() {
213        setTimeout(function() {
214          // close the dialog
215          $('#ndk_tos').trigger('modal-close');
216          // reload to refresh the tos or optionally forward the user
217           location.reload();
218        }, 3000);
219      });
220      ga('send', 'event', 'NDK', 'IDE and Tools', $("#downloadForRealz").html());
221      return true;
222    } else {
223      return false;
224    }
225  }
226
227
228  $(window).hashchange( function(){
229    if (location.hash == "") {
230      location.reload();
231    }
232  });
233
234</script>
235
236  <?cs else ?>
237<?cs # end if NDK ...
238#
239#
240#
241#
242#
243#
244# the following is for the SDK
245#
246# (nested in if/else redirect and if/else NDK)
247#
248#
249#
250#
251?>
252  <?cs if:android.whichdoc == "online" ?>
253
254
255<?cs ########  HERE IS THE JD DOC CONTENT FOR ONLINE ######### ?>
256<?cs call:tag_list(root.descr) ?>
257
258
259<section id="downloads" class="dac-section dac-small">
260<div class="wrap">
261
262<h2 class="norule">Start using Android Studio today</h2>
263
264<p>Android Studio includes all the tools you need to build apps for Android.</p>
265
266<div style="float:left;margin-right:40px;width:auto;">
267<p>
268  <a class="landing-button green download-bundle-button"
269    data-modal-toggle="studio_tos">Download Android Studio 2.0<br>
270  <span class="small"></span></a>
271</p>
272</div>
273
274<div style="float:left;width:auto;margin-bottom:40px">
275<ul class="nolist" style="text-transform: uppercase;margin:8px 0">
276<li>Version: <?cs var:studio.version ?></li>
277<li>Release date: <?cs var:studio.release.date ?></li>
278</ul>
279</div>
280
281
282
283<h4 style="clear:left;margin-top:40px">Select a different platform</h4>
284
285  <table class="download">
286    <tr>
287      <th>Platform</th>
288      <th>Android Studio package</th>
289      <th>Size</th>
290      <th>SHA-1 checksum</th>
291  </tr>
292  <tr>
293    <td rowspan="3">Windows</td>
294    <td>
295  <a onclick="return onDownload(this,false,true)" id="win-bundle" data-modal-toggle="studio_tos"
296    href="https://dl.google.com/dl/android/studio/install/<?cs var:studio.version ?>/<?cs var:studio.win_bundle_exe_download ?>"
297    ><?cs var:studio.win_bundle_exe_download ?></a><br>
298    Includes Windows installer (recommended)
299    </td>
300    <td id="win-bundle-size"><?cs call:size_in_mb(studio.win_bundle_exe_bytes) ?> MB
301      <br>(<?cs var:studio.win_bundle_exe_bytes ?> bytes)</td>
302    <td><?cs var:studio.win_bundle_exe_checksum ?></td>
303  </tr>
304  <tr>
305    <!-- blank TD from Windows rowspan -->
306    <td>
307  <a onclick="return onDownload(this,false,true)" id="win-bundle-zip" data-modal-toggle="studio_tos"
308    href="https://dl.google.com/dl/android/studio/ide-zips/<?cs var:studio.version ?>/<?cs var:studio.win_bundle_download ?>"
309    ><?cs var:studio.win_bundle_download ?></a><br>
310    No Windows installer
311    </td>
312    <td><?cs call:size_in_mb(studio.win_bundle_bytes) ?> MB
313      <br>(<?cs var:studio.win_bundle_bytes ?> bytes)</td>
314    <td><?cs var:studio.win_bundle_checksum ?></td>
315  </tr>
316  <tr>
317    <!-- blank TD from Windows rowspan -->
318    <td>
319  <a onclick="return onDownload(this,false,true)" id="win-bundle-notools" data-modal-toggle="studio_tos"
320    href="https://dl.google.com/dl/android/studio/install/<?cs var:studio.version ?>/<?cs var:studio.win_notools_exe_download ?>"
321    ><?cs var:studio.win_notools_exe_download ?></a><br>
322    Includes Windows installer but no SDK tools
323    </td>
324    <td><?cs call:size_in_mb(studio.win_notools_exe_bytes) ?> MB
325      <br>(<?cs var:studio.win_notools_exe_bytes ?> bytes)</td>
326    <td><?cs var:studio.win_notools_exe_checksum ?></td>
327  </tr>
328  <tr>
329    <td><nobr>Mac OS X</nobr></td>
330    <td>
331  <a onclick="return onDownload(this,false,true)" id="mac-bundle" data-modal-toggle="studio_tos"
332    href="https://dl.google.com/dl/android/studio/install/<?cs var:studio.version ?>/<?cs var:studio.mac_bundle_download ?>"
333    ><?cs var:studio.mac_bundle_download ?></a>
334    </td>
335    <td id="mac-bundle-size"><?cs call:size_in_mb(studio.mac_bundle_bytes) ?> MB
336      <br>(<?cs var:studio.mac_bundle_bytes ?> bytes)</td>
337    <td><?cs var:studio.mac_bundle_checksum ?></td>
338  </tr>
339  <tr>
340    <td>Linux</td>
341    <td>
342  <a onclick="return onDownload(this,false,true)" id="linux-bundle" data-modal-toggle="studio_tos"
343    href="https://dl.google.com/dl/android/studio/ide-zips/<?cs var:studio.version ?>/<?cs var:studio.linux_bundle_download ?>"
344    ><?cs var:studio.linux_bundle_download ?></a>
345    </td>
346    <td id="linux-bundle-size"><?cs call:size_in_mb(studio.linux_bundle_bytes) ?> MB
347      <br>(<?cs var:studio.linux_bundle_bytes ?> bytes)</td>
348    <td><?cs var:studio.linux_bundle_checksum ?></td>
349  </tr>
350  </table>
351
352
353
354<h4 class="norule" style="margin-top:40px">Get just the SDK tools</h4>
355
356<p>If you do not need Android Studio, you can download the basic
357Android SDK tools below.</p>
358
359  <table class="download">
360    <tr>
361      <th>Platform</th>
362      <th>SDK tools package</th>
363      <th>Size</th>
364      <th>SHA-1 checksum</th>
365  </tr>
366  <tr>
367    <td rowspan="2">Windows</td>
368    <td>
369  <a onclick="return onDownload(this)" id="win-tools" data-modal-toggle="studio_tos"
370    href="//dl.google.com/android/<?cs
371var:sdk.win_installer
372?>"><?cs var:sdk.win_installer ?></a><br>
373    Includes Windows installer
374    </td>
375    <td><?cs call:size_in_mb(sdk.win_installer_bytes) ?> MB
376      <br>(<?cs var:sdk.win_installer_bytes ?> bytes)</td>
377    <td><?cs var:sdk.win_installer_checksum ?></td>
378  </tr>
379  <tr>
380    <!-- blank TD from Windows rowspan -->
381    <td>
382  <a onclick="return onDownload(this)" id="win-tools2" data-modal-toggle="studio_tos"
383    href="//dl.google.com/android/<?cs var:sdk.win_download
384?>"><?cs var:sdk.win_download ?></a><br>
385    No Windows installer
386    </td>
387    <td><?cs call:size_in_mb(sdk.win_bytes) ?> MB
388      <br>(<?cs var:sdk.win_bytes ?> bytes)</td>
389    <td><?cs var:sdk.win_checksum ?></td>
390  </tr>
391  <tr>
392    <td><nobr>Mac OS X</nobr></td>
393    <td>
394  <a onclick="return onDownload(this)" id="mac-tools" data-modal-toggle="studio_tos"
395    href="//dl.google.com/android/<?cs
396var:sdk.mac_download
397?>"><?cs var:sdk.mac_download ?></a>
398    </td>
399    <td><?cs call:size_in_mb(sdk.mac_bytes) ?> MB
400      <br>(<?cs var:sdk.mac_bytes ?> bytes)</td>
401    <td><?cs var:sdk.mac_checksum ?></td>
402  </tr>
403  <tr>
404    <td>Linux</td>
405    <td>
406  <a onclick="return onDownload(this)" id="linux-tools" data-modal-toggle="studio_tos"
407    href="//dl.google.com/android/<?cs
408var:sdk.linux_download
409?>"><?cs var:sdk.linux_download ?></a>
410    </td>
411    <td><?cs call:size_in_mb(sdk.linux_bytes) ?> MB
412      <br>(<?cs var:sdk.linux_bytes ?> bytes)</td>
413    <td><?cs var:sdk.linux_checksum ?></td>
414  </tr>
415  </table>
416  <p>
417Also see the <a href="<?cs var:toroot ?>tools/sdk/tools-notes.html">SDK
418tools release notes</a>.</p>
419
420  </div><!-- end wrap -->
421  </section>
422
423
424<?cs ########  The Android Studio version of the download script ######### ?>
425<script>
426  var os;
427  var bundlename;
428  var $toolslink;
429
430  if (navigator.appVersion.indexOf("Mobile")!=-1) {
431    // Do nothing for any "mobile" user agent
432  } else if (navigator.appVersion.indexOf("Win")!=-1) {
433    os = "Windows";
434    bundlename = '#win-bundle';
435    $toolslink = $('#win-tools');
436  } else if (navigator.appVersion.indexOf("Mac")!=-1) {
437    os = "Mac";
438    bundlename = '#mac-bundle';
439    $toolslink = $('#mac-tools');
440  } else if (navigator.appVersion.indexOf("Linux")!=-1 && navigator.appVersion.indexOf("Android")==-1) {
441    os = "Linux";
442    bundlename = '#linux-bundle';
443    $toolslink = $('#linux-tools');
444  }
445
446  if (os != undefined) {
447    $('#not-supported').hide();
448
449    /* set up primary Android Studio download button */
450    idname = bundlename + "-size";
451    sizeMB = $(idname).text().split(' MB')[0];
452    $('.download-bundle-button > .small').html(" for " + os + " <em>(" + sizeMB + " MB)</em>");
453    $('.download-bundle-button').click(function() {return onDownload(this,true,true);}).attr('href', bundlename);
454  }
455
456
457  function onDownload(link, button, bundle) {
458
459    /* set text for download button */
460    if (button) {
461      $("#downloadForRealz").html($(link).text());
462    } else {
463      $("#downloadForRealz").html("Download " + $(link).text());
464    }
465
466    $("#downloadForRealz").attr('bundle', bundle);
467    if (bundle && !button) {
468      $("a#downloadForRealz").attr("name", "#" + $(link).attr('id'));
469    } else {
470      $("h2#tos-header").text('Download the Android SDK Tools');
471      $("a#downloadForRealz").attr("name", $(link).attr('href'));
472    }
473
474    return false;
475  }
476
477
478  function onAgreeChecked() {
479    /* verify that the TOS is agreed */
480    if ($("input#agree").is(":checked")) {
481
482      /* if downloading the bundle */
483      if ($("#downloadForRealz").attr('bundle')) {
484        /* construct the name of the link we want */
485        linkId = $("a#downloadForRealz").attr("name");
486        /* set the real url for download */
487        $("a#downloadForRealz").attr("href", $(linkId).attr("href"));
488      } else {
489        $("a#downloadForRealz").attr("href", $("a#downloadForRealz").attr("name"));
490      }
491
492      /* reveal the download button */
493      $("a#downloadForRealz").removeClass('disabled');
494    } else {
495      $("a#downloadForRealz").addClass('disabled');
496    }
497  }
498
499  function onDownloadForRealz(link) {
500    if ($("input#agree").is(':checked')) {
501      $("div.sdk-terms").slideUp();
502      if ($("#downloadForRealz").attr('bundle') == 'true') {
503        $("h2#tos-header").text('Now downloading Android Studio!');
504        $(".sdk-terms-intro").text('Redirecting to the install instructions...');
505        $("#sdk-terms-form").slideUp(function() {
506          setTimeout(function() {
507            window.location = "/sdk/installing/index.html";
508          }, 2000);
509        });
510      } else {
511        $("h2#tos-header").text('Now downloading the Android SDK Tools!');
512        $(".sdk-terms-intro").html("<p>Because you've chosen to download " +
513          "only the Android SDK tools (and not Android Studio), there are no " +
514          "setup procedures to follow.</p><p>For information about how to " +
515          "keep your SDK tools up to date, refer to the " +
516          "<a href='/tools/help/sdk-manager.html'>SDK Manager</a> guide.</p>");
517        $("#sdk-terms-form").slideUp();
518      }
519      ga('send', 'event', 'SDK', 'IDE and Tools', $("#downloadForRealz").html());
520      return true;
521    } else {
522      return false;
523    }
524  }
525
526  $(window).hashchange( function(){
527    if (location.hash == "") {
528      location.reload();
529    }
530  });
531
532</script>
533
534
535
536
537<?cs # THIS DIV WAS OPENED IN INDEX.JD ?>
538
539
540
541
542  <?cs else ?> <?cs # end if online ?>
543
544    <?cs if:sdk.preview ?><?cs # it's preview offline docs ?>
545      <p>Welcome developers! We are pleased to provide you with a preview SDK for the upcoming
546    Android 3.0 release, to give you a head-start on developing applications for it.
547    </p>
548
549      <p>See the <a
550    href="<?cs var:toroot ?>sdk/preview/start.html">Getting Started</a> document for more information
551    about how to set up the preview SDK and get started.</p>
552    <style type="text/css">
553    .non-preview { display:none; }
554    </style>
555
556    <?cs else ?><?cs # it's normal offline docs ?>
557
558      <?cs ########  HERE IS THE JD DOC CONTENT FOR OFFLINE ######### ?>
559      <?cs call:tag_list(root.descr) ?>
560      <style type="text/css">
561        body .offline { display:block; }
562        body .online { display:none; }
563      </style>
564      <script>
565        $('.reqs').show();
566      </script>
567    <?cs /if ?>
568
569  <?cs /if ?> <?cs # end if/else online ?>
570
571<?cs /if ?> <?cs # end if/else NDK ?>
572
573<?cs /if ?> <?cs # end if/else redirect ?>
574
575
576</div><!-- end jd-content -->
577
578<?cs if:!sdk.redirect ?>
579<?cs include:"footer.cs" ?>
580<?cs /if ?>
581
582</div><!-- end g-unit -->
583
584<?cs include:"trailer.cs" ?>
585<script src="https://developer.android.com/ytblogger_lists_unified.js?v=17" type="text/javascript"></script>
586<script src="/jd_lists_unified.js?v=17" type="text/javascript"></script>
587<script src="/jd_extras.js?v=17" type="text/javascript"></script>
588<script src="/jd_collections.js?v=17" type="text/javascript"></script>
589<script src="/jd_tag_helpers.js?v=17" type="text/javascript"></script>
590
591<!-- Start of Tag -->
592<script type="text/javascript">
593var axel = Math.random() + "";
594var a = axel * 10000000000000;
595document.write('<iframe src="https://2507573.fls.doubleclick.net/activityi;src=2507573;type=other026;cat=googl348;ord=' + a + '?" width="1" height="1" frameborder="0" style="display:none"></iframe>');
596</script>
597<noscript>
598<iframe src="https://2507573.fls.doubleclick.net/activityi;src=2507573;type=other026;cat=googl348;ord=1?" width="1" height="1" frameborder="0" style="display:none"></iframe>
599</noscript>
600<!-- End of Tag -->
601</body>
602</html>
603
604
605
606