Android Studio User-Defined Annotation Templates and generated JavaDoc and androidjavadoc
At the beginning, I learned about Android and used Android Studio IDE. To produce JavaDoc in the future, learn how to customize Annotation Templates.
. Custom annotation Template
1. Use File-> Settings or HotKey Ctrl + Alt + S to open the Settings panel, as shown in figure
2. Click Live Templates under the Editor. For example, the default template and shortcut keys provided by Android Studio for developers are displayed.
3. to customize the annotation Template, click "+" in the upper right corner and select Template Group to create a custom Template Group.
4. Select the created Template Group, click "+", and select Live Template to create a custom Template.
5. Select the created Templat, as shown in figure. Enter a string in Abbreviation, for example, decl. Enter the Description in Description.
6. Click Define at the bottom of the Template text input box, select the effect of the shortcut key, select Declaration, enter decl in front of the function, and press enter to generate comments based on the Template.
7. Enter the custom annotation Template in Template text. For variables such as $ xxx $, you can use Edit variables to set its meaning.
8. If you want to generate JavaDoc, you need to write the function annotation template according to the rules. For details about the rules, refer to Editor-> Code Style-> Java-> JavaDoc.
9. Click Tools> Generate JavaDoc to Generate Java Doc
10. If Java Doc Production fails, check whether Include jdk and library sources in-sourcepath is checked.
Other command line arguments, set the bootclasspath and encoding of the Android SDK
1. -bootclasspath D:\AndroidSDK\sdk\platforms\android-23
2. -encoding utf-8
3. -charset utf-8