Would you know whether it’s possible to store javadocs linked to jars so that they are available when not connected to the internet?
It seems that sometimes I can download javadocs for offline access, but not always.
For example, I would like to have this for offline access. How should I go about it ?
Try attaching the src jar to the library.
Take a look at this :
How to attach javadoc or sources to jars in libs folder?
In your case you would download and use the following jar.
http://pivotal.github.com/robolectric/downloads/robolectric-0.9.4-src.jar
Once you have attached the src jar you also have access to the Javadoc in the javadocs view.
Is there a Javadoc repository ?
To answer another part of your question, I do not know of an offline repository, but there is an online one worth exploring : http://www.docjar.org/
There is also an Eclipse plugin for docjar which can be installed using from here.
Having said that, I don’t think they would go to the trouble of generating javadoc for third part libraries like
roboelectricwhich provide one themselves. In that case, you are stuck generating the Javadocs manually using the steps in the following section.Generating Javadoc from src.jar
tl;dr : Using the steps below, I generated the Javadoc from the
robolectric-0.9.4-src.jarsource jar. The javadoc thus generated can be downloaded from here.Step 1:
Extract the
robolectric-0.9.4-src.jar(using 7-zip or another archive utility). Move theandroid,comandMETA-INFfolder inside a folder calledsrc(This is useful in the next step). Let’s say you extracted therobolectric-0.9.4-src.jarinsidec:\robo. It would now have the following folders :c:\robo\src\androidc:\robo\src\comc:\robo\src\META-INFStep 2:
Create an Eclipse project using the extracted source. This can be done by creating a new Java project inside Eclipse and instead of using the default workspace location, point to the location of the directory above (
c:\robo).Step 3:
Now run the javadoc wizard by going to
File -> Export -> Javadoclike so :Step 4:

Select ‘Private’ package to get Javadoc for all classes.
Step 5:

Next, select all jars except
tools.jarin referenced jars :Step 6:

Then, choose the path of the
overviewhtml and CheckOpen Generated File in browser:Step 7:
Click on Finish. On doing so, you’ll see the Javadoc task running in the Debug view :
And when it finishes a browser view should open with your Javadoc !

Step 8:
Profit ! Your Javadoc should now be generated and accessible.