Can I use shortcut keys in Android studio to generate javadoc comments?
If not, what is the easiest way to generate javadoc comments?
i recommendated Dokka for geneate javadoc with comment and more
In Android Studio you don't need the plug in. On A Mac just open Android Studio -> click Android Studio in the top bar -> click Prefrences -> find File and Code Templates in the list -> select includes -> build it and will be persistent in all your project
Just select the Eclipse version of the keycap in the Keymap settings. An Eclipse Keymap is included in Android Studio.
ALT+SHIFT+G will create the auto generated comments for your method (place the cursor at starting position of your method).
To generatae comments type /**
key before the method declaration and press Enter
. It will generage javadoc comment.
Example:
/**
* @param a
* @param b
*/
public void add(int a, int b) {
//code here
}
For more information check the link https://www.jetbrains.com/idea/features/javadoc.html
In Android studio we have few ways to auto-generated comments:
By typing /** and Then pressing Enter you can generate next comment line and it will auto-generate the params, etc. but when you need the hotkey for this check out method II on below.
1 - Goto topMenu
2 - File > Settings
3 - Select Keymap from settings
4 - On the top right search bar search for "Fix Doc"
5 - Select the "fix doc comment" from the results and double-click on it
6 - Select Add keyboard shortcut from the opened drop down after double-click
7 - Press the shortcut keys on the keyboard
8 - Goto your code and where you want to add some comment press the shortcut key
9 - Enjoy!