Android 离线文档和示例代码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2898053/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 07:47:22  来源:igfitidea点击:

Android offline documentation and sample codes

androiddocumentationoffline

提问by Nullpoet

I am not able to find the offline docs for android. Can someone provide a link?

我无法找到适用于 android 的离线文档。有人可以提供链接吗?

回答by Dan Lew

If you install the SDK, the offline documentation can be found in $ANDROID_SDK/docs/.

如果您安装了 SDK,可以在$ANDROID_SDK/docs/.

回答by Omniary

This thread is a little old, and I am brand new to this, but I think I found the preferred solution.

这个线程有点旧,我对此很陌生,但我想我找到了首选的解决方案。

First, I assume that you are using Eclipse and the Android ADT plugin.

首先,我假设您使用的是 Eclipse 和 Android ADT 插件。

In Eclipse, choose Window/Android SDK Manager. In the display, expand the entry for the MOST RECENT PLATFORM, even if that is not the platform that your are developing for. As of Jan 2012, it is "Android 4.0.3 (API 15)". When expanded, the first entry is "Documentation for Android SDK" Click the checkbox next to it, and then click the "Install" button.

在 Eclipse 中,选择 Window/Android SDK Manager。在显示中,展开 MOST RECENT PLATFORM 的条目,即使该平台不是您正在开发的平台。截至 2012 年 1 月,它是“Android 4.0.3 (API 15)”。展开后,第一个条目是“Android SDK 文档” 单击旁边的复选框,然后单击“安装”按钮。

When done, you should have a new directory in your "android-sdks" called "doc". Look for "offline.html" in there. Since this is packaged with the most recent version, it will document the most recent platform, but it should also show the APIs for previous versions.

完成后,您的“android-sdks”中应该有一个名为“doc”的新目录。在那里寻找“offline.html”。由于这是与最新版本一起打包的,它将记录最新的平台,但它也应该显示以前版本的 API。

回答by androidlah

here is direct link for api 17 documentation. Just extract at under docs folder. Hope it helps.

这是 api 17 文档的直接链接。只需在 docs 文件夹下提取。希望能帮助到你。

https://dl-ssl.google.com/android/repository/docs-17_r02.zip  (129 MB)

https://dl-ssl.google.com/android/repository/docs-17_r02.zip  (129 MB)

回答by Mohammad Reza Norouzi

At first choose your API level from the following links:

首先从以下链接中选择您的 API 级别:

API Level 17:http://dl-ssl.google.com/android/repository/docs-17_r02.zip

API 级别 17:http : //dl-ssl.google.com/android/repository/docs-17_r02.zip

API Level 18:http://dl-ssl.google.com/android/repository/docs-18_r02.zip

API 级别 18:http : //dl-ssl.google.com/android/repository/docs-18_r02.zip

API Level 19:http://dl-ssl.google.com/android/repository/docs-19_r02.zip

API 级别 19:http : //dl-ssl.google.com/android/repository/docs-19_r02.zip

Android-L API doc:http://dl-ssl.google.com/android/repository/docs-L_r01.zip

Android-L API 文档:http : //dl-ssl.google.com/android/repository/docs-L_r01.zip

API Level 24 doc:https://dl-ssl.google.com/android/repository/docs-24_r01.zip

API 级别 24 文档:https : //dl-ssl.google.com/android/repository/docs-24_r01.zip

download and extract it in your sdk driectory.

下载并将其解压缩到您的 sdk 目录中。



In your eclipse IDE:



在您的 Eclipse IDE 中:

at project -> properties -> java build path -> Libraries -> Android x.x -> android.jar -> javadoc

project -> properties -> java build path -> Libraries -> Android x.x -> android.jar -> javadoc

press edit in right:

按右边的编辑:

javadoc URL -> Browse

select "docs/reference/" in archive extracted directory

在存档提取目录中选择“docs/ reference/

press validate... to validate this javadoc.

validate... 验证此 javadoc。



In your IntelliJ IDEA



在您的 IntelliJ IDEA 中

at file -> Project StructureSelect SDKs from left panel -> select your sdk from middle panel -> in right panel go to Documentation Pathstab so click plus icon and select docs/reference/in archive extracted directory.

file -> Project Structure从左侧面板中选择 SDK -> 从中间面板中选择您的 sdk -> 在右侧面板中转到Documentation Paths选项卡,因此单击加号图标并docs/reference/在存档解压缩目录中选择。


enjoy the offline javadoc...


享受离线javadoc...

回答by systempuntoout

First of All you should download the Android SDK. Download here:
http://developer.android.com/sdk/index.html

首先,您应该下载 Android SDK。在这里下载:http:
//developer.android.com/sdk/index.html

Then, as stated in the SDK README:

然后,如 SDK README 中所述:

The Android SDK archive now only contains the tools. It no longer comes populated with a specific Android platform or Google add-on. Instead you use the SDK Manager to install or update SDK components such as platforms, tools, add-ons, and documentation.

Android SDK 存档现在只包含工具。它不再带有特定的 Android 平台或 Google 插件。相反,您可以使用 SDK 管理器来安装或更新 SDK 组件,例如平台、工具、附加组件和 文档

回答by zeratool

Write the following in linux terminal:

在linux终端中写入以下内容:

$ wget -r http://developer.android.com/reference/packages.html