1. Download the android-formatting.xml file

  2. Open Eclipse and go to Window->Preferences->Java->Code Style->Formatter

  3. Import theandroid-formatting.xmlfile 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” (如果不想显示空格的童鞋,可忽略这步)

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


更多相关文章

  1. Android下如何获取CPU序列号
  2. android中的汉字转拼音
  3. 使用命令行创建Android模拟器
  4. Android特殊字符
  5. android数字证书-签名(步骤)
  6. Android(安卓)Studio 使用NDK编译时常见的问题
  7. Android(安卓)混淆代码有关问题总结
  8. android studio 插件 - .ignore
  9. 如何手工创建android项目

随机推荐

  1. Android(安卓)OMAP4 Ducati 和 OpenMax I
  2. Android通讯录管理(获取联系人、通话记录
  3. Android之多种Bitmap效果
  4. 提高android ContentProvider的效率
  5. Android(安卓)ListView 特殊属性及用法
  6. android 7.0 相机,拍照 调裁切提示 “无法
  7. Android开发指南(42) —— Adding Custom
  8. Android(安卓)Studio 插件简介
  9. 5.3 ListView的HeaderView
  10. Android(安卓)中文 API (29) —— Compound