如何安装Android兼容包的javadoc?
如何为 android 1.4 兼容包生成自定义 javadoc?
参考文档可在线获取(示例) ,但是有什么地方可以获取带有离线可用 javadoc 的 zip 吗?
我想使用 javadoc 会非常简单,只需设置兼容性 jar 的 javadoc 位置即可。
How to generate custom javadoc for android 1.4 compatibility package?
The reference docs are available online (example), but is there some place where I can get a zip with javadoc available offline?
I suppose using the javadoc would be pretty simple, just a matter of setting the javadoc location for the compatibility jar.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您可以从源代码中自行离线生成 javadoc。只需导航到您的 android sdk 目录,然后执行以下操作
对于 Windows:
对于 Linux/Mac:
这将在您刚刚创建的 docs 目录中本地生成 javadocs。
然后在您的 Eclipse Android 项目中,转到您添加了
android-support-v4.jar
的项目属性,编辑其属性并添加您刚刚创建的 javadoc 的路径。那应该有效!
ADT 17+ 问题:
正如你们中的一些人所指出的。让 Eclipse 查看 ADT 17+ 的附加 javadoc 时出现问题。这是一个已知问题,并且已提交错误。这与生成 javadoc 的方式无关(如上所述),而是 ADT 17+ 与 Eclipse 集成的问题。有人描述了一种解决方法,可以在此处遵循:
http://code .google.com/p/android/issues/detail?id=28801
You can generate your javadoc offline on your own from the source code. Just navigate to your android sdk directory then do the following
For Windows:
For Linux/Mac:
This will generate your javadocs for you locally in the
docs
directory that you just created.Then in your eclipse android project, go to your project properties where you added the your
android-support-v4.jar
, edit it's properties and add the the path to the javadocs you just created.That should work!
ADT 17+ issues:
As some of you have pointed out. There have been issues getting Eclipse to see the attached javadoc for ADT 17+. This is a known issue and a bug has been filed. This is not related to the way you generate the javadoc (as I described above), rather this is an issue with ADT 17+ integrating with Eclipse. Someone has described a workaround and it can be followed here:
http://code.google.com/p/android/issues/detail?id=28801
问题:如果
android-support-v4.jar
位于/libs
文件夹中(按照 ADT 17+ 的要求),则 javadoc 不可用。编辑:我通过将离线版本的 android javadoc 链接到 android-support-v4.jar 解决了该问题。据我所知,仍然无法链接在线版本(http://developer.android.com/参考)。步骤:
MKLINK /J {PROJECT_PATH}\android_docs {SDK_PATH}\docs\reference
使用以下内容创建文件
libs/android-support-v4.jar.properties
:关闭项目并重新打开它。如有必要,请进行清理。
感谢这个答案 https://stackoverflow。 com/a/11579339/933261
Problem: If the
android-support-v4.jar
is in the/libs
folder (as the ADT 17+ require) the javadoc is unavailable.Edit: I have workarounded the problem by linking the offline version of the android javadoc to the android-support-v4.jar. As far as I know it is still not possible to link the online version (http://developer.android.com/reference). Steps:
MKLINK /J {PROJECT_PATH}\android_docs {SDK_PATH}\docs\reference
Create the file
libs/android-support-v4.jar.properties
with this content:Close the project and reopen it. Clean if necessary.
Thanks to this answer https://stackoverflow.com/a/11579339/933261
@wnafee 的答案很准确,但如果您使用的是 Linux,请不要忘记在此位置使用正斜杠字符,例如
src/java
。The answer by @wnafee is spot on, but if you are using Linux don't forget to use the forward slash character at this location like
src/java
.如果您在 WINDOWS 上并且像我一样被困了很长时间,请确保您在属性文件中逃脱了 backsmashes,否则事情会默默地失败。 (无论如何,谁会导致静默失败加载程序...)
这是我的属性文件:
我的目录如下所示:
关闭项目并打开,这一切都对我有用。
IF YOU'RE ON WINDOWS and get stuck for ages like me, make sure you escape your backsmashes in the properties file, or things will silently fail. (who makes silent failing loaders anyway...)
This this is my properties file:
and my dir looks like this:
close project and open, and it all works for me.
我根据 wnafee 的回答生成了这个:
https://dl.dropboxusercontent.com/u/31272696/android-support -v4.zip
I generated this one based on wnafee's answer:
https://dl.dropboxusercontent.com/u/31272696/android-support-v4.zip
我经历了所有这些解决方案,但没有一个有效。以下是我为使其正常工作所做的操作:
导航到以下文件夹:
D:\\Android-SDK\android-sdk-windows\extras\android\support\v4
运行命令:
javadoc -d docs -sourcepath src\java -subpackages android.support.v4
在项目的 libs 目录中,创建一个名为 android-support-v4.jar.properties 的文件
在属性文件中,添加以下行(更改路径以匹配您的路径):
doc=D:\Program Files\Android-SDK\android-sdk-windows\extras\android\support\v4\docs
src=D:\Program Files\Android-SDK\android-sdk-windows\extras\android\support\v4\src
在 Eclipse 中,打开构建的属性对话框,然后导航到 Java 构建路径并选择Libraries 选项卡。
扩展支持库。就我而言,路径是:
D:\Program Files\Android-SDK\android-sdk-windows\extras\android\support\v4
选择 Javadoc 位置。单击“编辑”按钮,然后选择文档的路径。就我而言,是:
file:/D:/Program Files/Android-SDK/android-sdk-windows/extras/android/support/v4/docs/
关闭所有内容,包括 Eclipse 并重新启动。您现在应该能够浏览代码中的文档。
I went through all of these solutions and none of them worked. Here is what I did to get it to work:
Navigate to the following folder:
D:\\Android-SDK\android-sdk-windows\extras\android\support\v4
Run the command:
javadoc -d docs -sourcepath src\java -subpackages android.support.v4
In your project's libs directory, create a file called android-support-v4.jar.properties
In the properties file, add the following lines (change the path to match yours):
doc=D:\Program Files\Android-SDK\android-sdk-windows\extras\android\support\v4\docs
src=D:\Program Files\Android-SDK\android-sdk-windows\extras\android\support\v4\src
In Eclipse, bring up the properties dialog for the Build, then navigate to Java Build Path and select the Libraries tab.
Expand the support library. In my case the path is:
D:\Program Files\Android-SDK\android-sdk-windows\extras\android\support\v4
Select Javadoc location. Click on the Edit button and then select the path to the docs. In my case it was:
file:/D:/Program Files/Android-SDK/android-sdk-windows/extras/android/support/v4/docs/
Close everything, including Eclipse and restart. You should now be able to browse docs in your code.