本文介绍了如何使Google Play服务API和Firebase API的API javadoc在Android Studio中显示,而不是反编译的没有文档的类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 当我在Android Studio中的Android项目中单击任何Google Play服务API或Firebase API时,IDE会将我带到变量名称被混淆的类的反编译版本,而且没有文档的任何方法。任何想法如何直接在IDE中看到文档? 我怀疑是因为播放服务和firebase服务不是开源的,我很好不是看到这个impls,我明白他们想保护那个。但是,直接在IDE中查看文档,而不是在浏览器中查看文档,我确实会受益匪浅。感谢您的帮助。解决方案 Javadocs确实应该与客户端库一起分发。我们在Google这个问题上有一个公开的问题,但是我没有时间表,什么时候会有适当的解决方案。不过,我可以给你一个解决方法,你可以应用到你的项目。 在我的OSX机器上,Android SDK安装在这里: / Users / [myusername] / Library / Android / sdk / Users / [myusername] / Library / Android / sdk / extras / google / google_play_services / docs / reference / 这个过程在Android Studio中的Firebase客户端库的路径: $ b 在项目视图中查找Firebase / Play客户端库External Libraries 。 右键单击您最感兴趣看到的javadoc。例如,对于Firebase实时数据库,您可以使用firebase-database-9.2.0。 在上下文菜单中,单击底部的库属性。 在库属性窗口中,有一个带有+号的按钮。点击。这允许您将javadoc路径附加到该库中的类。 导航/将上面的javadoc路径粘贴到对话框中。 对话框中,告诉它JavaDocs。 现在,当你召唤javadoc在库中的类时,你会看到它。但是,您必须为每个需要javadoc的库执行此操作。 如果由于某种原因没有安装本地javadoc,则可以将远程javadoc的网址。为此,请使用带有小地球的加号按钮,并粘贴javadoc网址。对于Firebase,这是 https://firebase.google.com/docs/reference/android 对于Play服务,这是 https://developers.google.com/android/reference/ 完成所有这些手动工作并不是件好事,但至少可以让您在IDE中使用javadoc。 如果你想编写一个脚本来附加这个你使用的所有东西,知道这个过程本质上只是修改.idea /库下的文件。您可以很容易地观察在IDE中进行更改时被修改的javadoc XML元素,如果需要,您可以自己编写/编辑更改。 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 where the variable names are obfuscated and there are no docs on any of the methods. Any ideas how to see the docs directly in the IDE?I suspect the reason is that play services and firebase services are not open source and I'm ok with not seeing the impls, I understand they want to protect that. But I'd really benefit from seeing the docs directly in the IDE rather than alt-tabbing to a browser. Thanks for your help. 解决方案 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/sdkAnd 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:Find Firebase/Play client libraries in the project view under "External Libraries".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".In the contextual menu, click Library Properties at the bottom.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.Navigate/Paste your javadoc path from above into the dialog.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. 这篇关于如何使Google Play服务API和Firebase API的API javadoc在Android Studio中显示,而不是反编译的没有文档的类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-22 14:46