How to enable javadoc for android support library?

When using the Android support library for compatibility and try looking at javadoc, say FragmentTransaction , I get the following error because there is no javadoc file associated:

android.support.v4.app.FragmentTransaction

Note. This element neither attached the source nor added Javadoc and therefore Javadoc could not be found.

The support library is added to the Android Dependencies element in the project properties and shows the location of the Javadoc: (No) - it is not modified, as shown below. Is there a workaround for this?

enter image description here

+42
android javadoc android-support-library
Sep 27 '12 at 19:07
source share
3 answers

I integrated the project with android-v4jar support only in the Android Dependencies part in the package view. I have a class

 public class CountriesFragment extends ListFragment {...} 

and import

 import android.support.v4.app.ListFragment; 

up higher

I created the android-support-v4.jar.properties file 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 will have to switch to an unexperienced slash if you do not use Windows.

Then right click on the project, select update, then you will get javadoc support. You really don't need a doc entry - the src entry already contains javadocs.

+53
Sep 27 '12 at 20:17
source share

Edited: Refer to the following post:

How to connect javadoc or sources to banks in the libs folder?

Added:

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

Hope this helps :)

Added:

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

according to this

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

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

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

+6
Sep 27 '12 at 19:17
source share

In Eclipse: Go to the β€œFile” menu β†’ β€œOpen File” β†’ find the β€œProject” directory in the workspace β†’ select the .classpath openit file β†’

Keep only below entries in this file and delete 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 the necessary files for the project if you want to cross-check the .classpath file and check for updates in it.

Run the project successfully :)

0
May 24 '13 at 11:33
source share



All Articles