Javadoc on Android (Eclipse)

I am trying to create javadoc html pages for my Android project in Eclipse. I tried using the argument -linkofflinesuggested here as well as the argument -classpathpointing to the android.jar file. None of them worked, as I am still receiving warnings package android.app does not exist(and others). I also tried to run the javadoc tool from the command line, instead of using Eclipse.

Ideally, I would like to have my own pages for my classes, with all android classes. * and java. * linking to online pages. I am using Mac OS 10.6 with Java version 1.6.0_20.

+5
source share
2 answers

When I tried to solve a similar problem, I found two main points:

  • To include the android.jar file that you associate with the classpath attribute of the javadoc Ant task. This means something like the following:

    <javadoc ... 
      classpath="some/local/library.jar;
        C:/Android/platforms/android-8/android.jar;
        D:/another/library.jar" ... >
    
  • To add a link subtype in the javadoc task to match the online address of the Android link with a local copy of the Android Reference package list. This means something like the following:

    <javadoc ...>
       <link offline="true" 
         href="http://developer.android.com/reference/" 
         packagelistloc="C:/Android/docs/reference" />
    </javadoc>
    

That was enough to show Android links in my Javadoc project.

+3
source

ant script javadocs? javadoc.xml - , build.xml. eclipse script. ant script eclipse (RMB on file | Run As | Ant Build), : ant -f <file-name.xml>.

:

<project basedir="." default="doc" name="metagloss api docs">

    <property 
        name="android-sdk-docs"
        value="/home/blackrax/opt/dev/android-sdk-linux_86/docs/reference"/>

    <target name="doc" description="api docs - no piwik" depends="clean, delombok">
        <javadoc destdir="docs">
            <link offline="true"
                  href="http://d.android.com/reference"
                  packagelistLoc="${android-sdk-docs}" />
            <fileset dir="src" includes="**/*.java" />
        </javadoc>
    </target>

    <!-- more implementation, any remaining targets -->
</project>
+1

All Articles