Generate a Javadoc for my Android project Generate a Javadoc for my Android project android android

Generate a Javadoc for my Android project


I was able to get Javadocs generated for all my classes by making sure that I had the "Documentation for Android SDK" component installed in the Android SDK and AVD Manager, and selecting android.jar as a reference archive in step 2 of the Javadoc generation.

It didn't generate links to the reference docs, but it did create docs for all of my classes.


I was a bit stubborn, and didn't setup Maven... hopefully this post helps someone else that's in the same boat.

After a bit of trial and error (And plenty of suggestions gleaned from multiple web searches), I was able to get this working with a specific ANT script, which can be run in Eclipse by "Run As -> Ant Build".

I saved this file, "javadoc.xml", in the directory of my project, in parallel with the AndroidManifest.xml file.

Here is the content of the file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><project basedir="." default="doc" name="api docs"><target name="doc" description="my docs">    <javadoc destdir="docs" doctitle="Testing the Title" verbose="on"         use="true"         classpath="C:\Android\android-sdk_r04-windows\android-sdk-windows\platforms\android-2.1\android.jar;.\libs\admob-sdk-android.jar"        sourcepath="gen;src"        linkoffline="http://d.android.com/reference C:\Android\android-sdk_r04-windows\android-sdk-windows\docs\reference"        stylesheetfile="C:\Android\android-sdk_r04-windows\android-sdk-windows\docs\assets\android-developer-docs.css"        >    </javadoc></target></project>


What worked for me was setting the classpath to android.jar. In Eclipse: project -> generate javadoc -> 3rd step under "extra javadoc options." E.g.

-classpath "C:\android-sdk-windows\platforms\android-11\android.jar"