Android Studio User-Defined Annotation Templates and generated JavaDoc and androidjavadoc

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.