Search code examples
androidandroid-studio-2.3

How to use Android SDK Documentation offline


I've downloaded Android SDK Documentation using SDK Manager, to use it with Android Studio v2.3.0.8, offline.

But everytime I press ctrl+q to show quick info about a type|type-member, it shows "Fetching Documentation...", and after waiting for ~20s, it shows the info.

I don't want that delay or using online help, and the local docs are in place, so why is that ? And what is the solution ?

Edit: This happens when I'm online, but no delay at all when I'm offline, As if the IDE tries to get a fresh version of docs.


Solution

  • Improved solution for displaying documentation (from sources).

    Found, that if you download documentation via SDK manager (it will be located in .../sdk/docs/reference), you're going to use only 24 API documentation. (Imagine, your project target SDK is 25 or 22, for instance).

    Only 24 API in downloaded documentation

    To fix this, you need:

    1. Delete documentation via SDK manager in Android Studio. Delete documenattion in SDK manager
    2. Right there, download sources for interested APIs (sources already contain documentation). Also I found, that fetching documentation from sources a bit faster comparing with offline one inside .../sdk/docs/reference. Download sources via SDK manager for interested APIs
    3. Delete all javadoc paths from jdk.table.xml. Path to this file on OS X: ~/Library/Preferences/AndroidStudio.../options/jdk.table.xml

      --> Delete all of these and all occurrences -->
      
      <javadocPath>
        <root type="composite">
          <root type="simple" url="http://developer.android.com/reference/" />
        </root>
      </javadocPath>
      
    4. Reboot Studio. Enjoy!