How can I enable javadoc for the Android support library?

主宰稳场 提交于 2019-11-27 12:01:52
NickT

I've lashed together a project with android-support-v4.jar just in the Android Dependencies part of the package view. I have a class

public class CountriesFragment extends ListFragment {...}

and an import of

import android.support.v4.app.ListFragment;

up above

I created a file android-support-v4.jar.properties in the libs folder. It contains the lines:

doc=c:\\[path-to-android-sdk]\\docs\\reference
src=C:\\[path-to-android-sdk]\\extras\\android\\support\\v4\\src

Presumably you'll have to change to un-escaped forward slashes if not using Windows.

Next right-click the project, select refresh, then you'll get javadoc support. You don't really need the doc entry--the src entry already contains the javadocs.

Vishal Vyas

Edited: Refer the following post :

How to attach javadoc or sources to jars in libs folder?

Added:

Under \android-sdk\extras\android\support\v4 directory of your Android SDK installation you will find the sources for android-support-v4.jar (i.e. the src directory) and you can create a jar file of the same using jar command.

Hope it helps :)

Added:

Check this post https://android-review.googlesource.com/#/c/35702/

according to this

Create a file named android-support-v4.jar.properties in the libs directory of your project and add following line into it.

src: <relative or absolute path to the source folder (or archive).>

I tried this solution and it worked for me. Enjoy :)

In Eclipse: Go to File Menu-> Open file-> browse your Project directory in workspace -> select the .classpath file openit->

Keep only below entries in this file and remove all others

`<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="lib" path="your dir path without space.../extras/android/support /v4/android-support-v4.jar"/>
<classpathentry kind="output" path="bin/classes"/>
 </classpath>

Save the file. then in Eclipse-> Package Explorer ->right click Project -> Android tools -> Fix Project Properties.

This will add all required files to project , if you want to cross check open .classpath file again and check updates in it.

Run the project successfully :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!