How to make API javadocs for Google Play Services APIs and Firebase APIs show up in Android Studio rather than decompiled classes with no docs?

前端 未结 2 643
后悔当初
后悔当初 2020-12-24 13:27

When I click on any Google Play Services API, or Firebase API that I\'m using in my android project in Android Studio, the IDE takes me to a decompiled version of the class

相关标签:
2条回答
  • 2020-12-24 14:08

    In my case, adding this https://firebase.google.com/docs/reference/android/packages worked.

    0 讨论(0)
  • 2020-12-24 14:09

    Javadocs really should be distributed with the client libraries. We have an open issue within Google on this, but I have no timelines on when a proper solution will be available. However, I can give you a workaround that you can apply to your project. It's not a great solution, but it's something.

    On my OSX machine, the Android SDK is installed here:

    /Users/[myusername]/Library/Android/sdk
    

    And the local copy for Play Services and Firebase javadocs are here (yours may vary):

    /Users/[myusername]/Library/Android/sdk/extras/google/google_play_services/docs/reference/
    

    You can actually attach this path to your Firebase client libraries in Android Studio with this procedure:

    1. Find Firebase/Play client libraries in the project view under "External Libraries".
    2. Right click the one you're most interested in seeing javadoc. For example, for Firebase Realtime Database, you can use "firebase-database-9.2.0".
    3. In the contextual menu, click Library Properties at the bottom.
    4. In the Library Properties window, there is a button that has a + sign. Click that. This lets you attach a javadoc path to classes in that library.
    5. Navigate/Paste your javadoc path from above into the dialog.
    6. In the next dialog, tell it "JavaDocs".

    Now, when you summon javadoc for classes in that library, you'll see it. However, you'll have to do this for every library where you want javadoc.

    If you don't have local javadocs installed for some reason, you can attach the remote url for the javadoc. For that, use the plus button with the little earth under it, and paste the javadoc url. For Firebase, that's https://firebase.google.com/docs/reference/android and for Play Services, that's https://developers.google.com/android/reference/

    It's not great to do all this manual work, but at least it gets you javadoc in your IDE.

    If you want to write a script to attach this for everything you use, know that this procedure essentially just modifies files under .idea/libraries. You can pretty easily observe the javadoc XML element that gets modified when you make changes in the IDE, and you can script/edit changes there yourself if you want.

    0 讨论(0)
提交回复
热议问题