Summary of Android code formatting Methods

Source: Internet
Author: User
  1. Download
    Android-formatting.xml File
  2. Open eclipse and go to window-> preferences-> JAVA-> code style-> formatter
  3. Import the android-formatting.xml file and make sure "Android" is selected in the drop down list
  4. In eclipse go to window-> preferences-> General-> editors-> text editors
  5. Check "insert spaces for tabs" and make sure that "displayed tab width" is 4
  6. Check "show print margin" and make sure that "Print margin columns" is 100
  7. Check "show whitespace characters" (skip this step if you do not want to display any space in the shoes)
  8. In eclipse go to window-> preferences-> JAVA-> Editor-> SAVE actions
  9. Check "perform the selected actions on Save"
  10. Check "additional actions" than hit configure
  11. Under the "Code organizing" tab check "Remove trailing whitespace" for all lines and "correct indention"
  12. Under the "Code style" tab remove all check marks
  13. Under the "missing code" tab check everything
  14. Now go to window-> preferences-> XML files-> Editor
  15. Check "Split multiple attributes each on a new line"
  16. Check "indent using spaces" and make sure the value is set to 4

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: 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.