New version of ADT r17 plugin for Eclipse added feature to automatically setup JAR dependencies. Any .jar files in the /libs folder are added to the build configuration now. Unfortunately Android Dependencies classpath container is non modifiable.
How can i attach javadoc and sources to the automatically inserted .jar (from /libs folder)?
The best way to answer your question is to summarize the answers from Xavier, plastiv, VinceFR and Christopher.
In order to link the sources and javadoc to a .jar library that is automatically linked by Eclipse you have to do the following:
.properties
file in the libs folder with the exact name of the actual library .jar (see example). Make sure you keep the .jar part..properties
file.The example uses the Gson library.
libs
├── docs
│ └── gson-2.2.2-javadoc.jar
├── gson-2.2.2.jar
├── gson-2.2.2.jar.properties
└── src
└── gson-2.2.2-sources.jar
src=src/gson-2.2.2-sources.jar
doc=docs/gson-2.2.2-javadoc.jar
You can of course move the javadoc and sources .jar into other folders and specify relative paths. That's up to you. Placing the source and javadoc jars directly into the lib folder is possible but not recommended, as that causes documentation and source code to be included in your application.
Screenshot of the Eclipse JavaDoc panel:
Screenshot of an Eclipse project using Gson with Android 4.2.2.:
In case you want to reference javadocs which are not provided as a packed .jar
but simply as files and folders as asked by android developer in the comments do the following:
.jar
in the libs/
folderCreate a yourlibraryname.jar.properties
file (don't forget the .jar
) with the following content:
doc=docs
Add the javadocs folders to the libs/
folder.
You should come up with the following folder structure:
├── docs
│ ├── allclasses-frame.html
│ ├── allclasses-noframe.html
│ ├── com
│ │ └── google
│ │ └── ads
│ │ ├── Ad.html
│ │ │ ....
│ │ └── package-tree.html
│ │ ...
│ └── stylesheet.css
├── GoogleAdMobAdsSdk-6.4.1.jar
└── GoogleAdMobAdsSdk-6.4.1.jar.properties
Do not forget to close and re-open the Eclipse project as mentioned above! Here is a screenshot of a working example project referencing the GoogleAdMobAds Android library.