summaryrefslogtreecommitdiff
path: root/docs/html-intl/intl/zh-cn/sdk/installing/adding-packages.jd
diff options
context:
space:
mode:
Diffstat (limited to 'docs/html-intl/intl/zh-cn/sdk/installing/adding-packages.jd')
-rw-r--r--docs/html-intl/intl/zh-cn/sdk/installing/adding-packages.jd227
1 files changed, 227 insertions, 0 deletions
diff --git a/docs/html-intl/intl/zh-cn/sdk/installing/adding-packages.jd b/docs/html-intl/intl/zh-cn/sdk/installing/adding-packages.jd
new file mode 100644
index 000000000000..04f55b10da97
--- /dev/null
+++ b/docs/html-intl/intl/zh-cn/sdk/installing/adding-packages.jd
@@ -0,0 +1,227 @@
+page.title=添加 SDK 软件包
+
+page.tags=sdk 管理器
+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>
+默认情况下,Android SDK
+并不包括您着手开发所需的一切内容。SDK
+将工具、平台和其他组件分成若干个软件包,您可以通过
+<a href="{@docRoot}tools/help/sdk-manager.html">Android SDK 管理器</a>根据需要下载这些软件包。因此您需要先为 Android SDK
+添加几个软件包,然后才能着手开发。</p>
+
+<p>要添加软件包,请先通过下列方式之一启动 Android SDK 管理器:</p>
+<ul>
+ <li>在 Android Studio 中,点击工具栏中的 <strong>SDK 管理器</strong>
+<img src="{@docRoot}images/tools/sdk-manager-studio.png" style="vertical-align:bottom;margin:0;height:17px" />。</li>
+ <li>如果您未使用 Android Studio:
+ <ul>
+ <li>Windows:双击 Android
+ SDK 根目录中的 <code>SDK Manager.exe</code> 文件。</li>
+ <li>Mac/Linux:打开一个终端,导航到 Android SDK 安装
+位置的 <code>tools/</code> 目录,然后执行 <code>android sdk</code>。</li>
+ </ul>
+ </li>
+</ul>
+
+<p>当您首次打开 SDK
+管理器时,有几个软件包默认处于选定状态。保持它们的选定状态,但务必按照下列步骤获得着手开发所需的一切内容:
+</p>
+
+
+<ol class="large">
+<li>
+ <h2 id="GetTools" class="norule">获得最新的 SDK 工具</h2>
+
+<img src="/images/sdk_manager_packages.png" alt="" width="350" style="float:right;margin-left:20px" />
+
+ <p>在安装 Android SDK 时,
+您至少应下载最新工具和 Android 平台:</p>
+ <ol>
+ <li>打开 Tools 目录并选择:
+ <ul>
+ <li><strong>Android SDK Tools</strong></li>
+ <li><strong>Android SDK Platform-tools</strong></li>
+ <li><strong>Android SDK Build-tools</strong>(最高版本)</li>
+ </ul>
+ </li>
+ <li>打开第一个 Android X.X 文件夹(最新版本)并选择:
+ <ul>
+ <li><strong>SDK Platform</strong></li>
+ <li>模拟器系统映像,例如 <br>
+ <strong>ARM EABI v7a System Image</strong></li>
+ </ul>
+ </li>
+ </ol>
+</li>
+
+<li>
+ <h2 id="GetSupportLib" class="norule">获得其他 API 的支持库</h2>
+
+ <div class="sidebox">
+ <p>以下项目需要支持库:</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>它还提供了以下受欢迎的 API:</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><a href="{@docRoot}tools/support-library/features.html">Android 支持库</a>提供了一组丰富的 API,可兼容大多数版本的 Android。
+</p>
+
+ <p>打开 <strong>Extras</strong> 目录并选择:</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">为更多 API 获得 Google Play 服务</h2>
+
+ <div class="sidebox">
+
+ <p>Google Play services API 为您的 Android
+ 应用提供了各种功能和服务,例如:</p>
+ <ul>
+ <li><a href="{@docRoot}google/play-services/plus.html">用户身份验证</a></li>
+ <li><a href="{@docRoot}google/play-services/maps.html">Google 地图</a></li>
+ <li><a href="{@docRoot}google/play-services/cast.html">Google Cast</a></li>
+ <li><a href="{@docRoot}google/play-services/games.html">游戏成就和
+排行榜</a></li>
+ <li><a href="{@docRoot}google/play-services/index.html">更多其他功能</a></li>
+ </ul>
+ </div>
+
+ <p>要使用 Google API 进行开发,您需要 Google Play 服务包:</p>
+ <p>打开 <strong>Extras</strong> 目录并选择:</p>
+ <ul>
+ <li><strong>Google Repository</strong></li>
+ <li><strong>Google Play services</strong></li>
+ </ul>
+
+ <p class="note"><strong>注:</strong>并非所有采用
+ Android 技术的设备上都提供 Google Play Services API,但所有安装了 Google Play 商店的设备均提供这些 API。要在 Android 模拟器中使用这些
+ API,您还必须安装 SDK 管理器中最新 Android X.X 目录内的 <strong>Google APIs</strong>
+ 系统映像。</p>
+</li>
+
+
+<li>
+ <h2 id="Install" class="norule">安装软件包</h2>
+ <p>选择想要安装的所有软件包后,即可继续执行安装:</p>
+ <ol>
+ <li>点击 <strong>Install X packages</strong>。</li>
+ <li>在下一个窗口中,双击左侧的每个软件包名称,
+以接受各软件包的许可协议。</li>
+ <li>点击 <strong>Install</strong>。</li>
+ </ol>
+ <p>SDK 管理器窗口底部显示下载进度。
+ <strong>切勿退出 SDK 管理器</strong>,否则它会取消下载。</p>
+</li>
+
+<li>
+ <h2 id="Build" class="norule">赶快着手开发吧!</h2>
+
+<p>现在您的 Android SDK 已包含上述软件包,您随时可以着手开发
+ Android 应用。当新工具以及其他 API 推出时,只需启动 SDK 管理器
+,为您的 SDK 下载新软件包。</p>
+
+<p>以下几个方案可为您的开发工作提供指导:</p>
+
+<div class="cols" style="padding:10px 0">
+<div class="col-4">
+<h3>入门指南</h3>
+<p>如果您是第一次开发 Android
+应用,请按照<strong><a href="{@docRoot}training/basics/firstapp/index.html">开发您的第一款应用</a></strong>指南了解 Android 应用的基础知识。</p>
+
+</div>
+<div class="col-4 box">
+<h3>开发穿戴式设备应用</h3>
+<p>如果您已准备好着手开发 Android
+穿戴式设备应用,请参阅<strong><a href="{@docRoot}wear/preview/start.html">开发 Android Wear 应用</a></strong>。</p>
+
+</div>
+<div class="col-4 box">
+<h3>使用 Google API</h3>
+<p>要开始使用 Google API,例如 Google Maps API 或 Google
+Play Game Services
+API,请参阅<strong><a href="{@docRoot}google/play-services/setup.html">设置 Google Play
+服务</a></strong>指南。</p>
+
+</div>
+</div><!-- end cols -->
+
+
+</li>
+
+</ol>
+
+