Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javadoc on Android (Eclipse)

I am trying to generate Javadoc html pages for my Android project in Eclipse. I have tried using the -linkoffline argument, as suggested here, as well as using the -classpath argument pointing to my android.jar file. Neither of these worked, as I still get package android.app does not exist (and other) warnings. I have also tried running the javadoc tool from the command line, rather than using Eclipse.

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

like image 728
idolize Avatar asked Oct 15 '22 02:10

idolize


1 Answers

While trying to resolve a similar issue myself, the two main points I've found have been:

  • To include the android.jar file you're linking to within the classpath attribute of the javadoc Ant task. That 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 subitem under javadoc task in order to match the online Android Reference URL with a local copy of Android Reference package-list. That means something like the following:

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

This was enough for me in order to show Android links within my project Javadoc.

like image 76
superjos Avatar answered Oct 16 '22 14:10

superjos