android代码格式化方法小结
转载:http://blog.csdn.net/androidzhaoxiaogang/article/details/7692526
Download the android-formatting.xml file
Open Eclipse and go to Window->Preferences->Java->Code Style->Formatter
Import the android-formatting.xml file and make sure “Android” is selected in the drop down list
In eclipse go to Window->Preferences->General->Editors->Text Editors
Check “Insert spaces for tabs” and make sure that “Displayed tab width” is 4
Check “Show print margin” and make sure that “Print margin Columns” is 100
Check “Show Whitespace characters” (如果不想显示空格的童鞋,可忽略这步)
In eclipse go to Window->Preferences->Java->Editor->Save Actions
Check “Perform the selected actions on save”
Check “Additional Actions” than hit configure
Under the “Code Organizing” tab check “Remove trailing whitespace” for all lines and “Correct Indention”
Under the “Code Style” tab remove all check marks
Under the “Missing Code” tab check everything
Now go to Window->Preferences->XML->XML Files->Editor
Check “Split multiple attributes each on a new line”
Check “indent using spaces” and make sure the value is set to 4
android代码格式化方法小结的更多相关文章
- 下载最新Android代码的方法
之前我是去Android官方网站下载最新Android代码,但是这种方法需要FQ,而且有时候FQ又不太方便,今天我发现一个不错的网站,是清华大学搞的,跟Android官方的代码基本保持同步,而且下载方 ...
- Android root检测方法小结
转载目的,之前主要应用这里的原理解决了,手机被某个APP检测为root过的手机的问题,记录后续可能参考. 出于安全原因,我们的应用程序不建议在已经root的设备上运行,所以需要检测是否设备已经root ...
- Android ViewPager使用方法小结
android-support-v4.jar 是谷歌提供给我们的一个兼容低版本安卓设备的软件包,里面包囊了只有在 Android 3.0 以上可用的API.而 ViewPager 就是其中之一.利用它 ...
- Android PopupWindow使用方法小结
前几天要用到PopupWindow,一时竟想不起来怎么用,赶紧上网查了查,自己写了个demo,并在此记录一下PopupWindow的用法. 使用场景 PopupWindow,顾名思义,就是弹窗,在很多 ...
- Android代码混淆官方实现方法
首先查看一下 “project.properties” 这个文件: # This file is automatically generated by Android Tools.# Do not m ...
- 在Eclipse中格式化Android代码
我们用Eclipse做Android开发的时候,可以导入Google提供的profile文件,这样每次"Ctrl+Shift+F"的时候,IDE就能够按照官方的规范来进行代码格式化 ...
- keil中使用Astyle格式化你的代码的方法2篇合
关于Astyle Astyle 的全称是Artistic Style的简称,是一个开源的源代码格式化工具,可以对C,C++,C#以及Java等编程语言的源代码进行缩进.格式化.美化.Home Page ...
- 将应用代码由eclipse导入Android studio的方法NDK-Build和Cmake两种方法(以android_serialport_api为例)
网上翻了几百篇博客,看了半天,要不就是写的乱七八糟看不懂,要不就是隐藏了一些细节,要不就是实现不了,最后还是在Android官网上看明白了,而且说得有条有理,以后遇到不懂的一定要先翻官网. 参考资料: ...
- ecplice中代码使用快捷键无法格式化,使用其他方法将代码格式化的步骤
选中需要进行格式化的代码--->右键--->source--->format,就可以将代码格式化了.
随机推荐
- C#的初步学习,心得
- Java中新建子文件夹和新建文件
File file = new File("地址"); file.mkdirs(); //新建文件夹,当没有父文件夹时,但是不会自动创建父文件夹 file.mkdirs(); // ...
- maven添加本地依赖包方法
1.某些情况下不方便上传本地依赖包到Maven repository,可以通过下面方法添加本地依赖包. 2.方法 1).pom.xml中添加以下代码块 <dependency> <g ...
- xss框架的一些想法
今天pybeef作为一个课程设计答辩完成了,向老师介绍了很多xss利用相关的场景和技术. 先说一下已经实现了什么, 1, 浏览器版本的判断 这方面只能判断IE和firefox 火狐判断只判断了user ...
- Activity设置singleTask无法通过Intent获取值的问题
AActivity跳转BActivity ,AActivity设置lauchmode = "SingleTask"的话,在getIntent无法获取BActivity里面的内容,无 ...
- RF接口测试本地环境部署
##1 Python环境及robotframework安装 ###1.1 安装python 2.7.9(自带pip) + 下载python,双击msi文件安装 >https://www.pyth ...
- http验证CertificateValidation
private void btnopenURL_Click(object sender, EventArgs e) { string strUrl = txtopenURL.Text.Trim(); ...
- 4、File类之获取方法
这些方法也都是File类内置的成员方法,无需我们写,直接拿来用即可. 基本获取 public class Demo { public static void main(String[] args) { ...
- PAT 团体程序设计天梯赛-练习集 L1-023. 输出GPLT
给定一个长度不超过10000的.仅由英文字母构成的字符串.请将字符重新调整顺序,按“GPLTGPLT....”这样的顺序输出,并忽略其它字符.当然,四种字符(不区分大小写)的个数不一定是一样多的,若某 ...
- ubuntu libtiff-dev
cc@cc:~$ dpkg -L libti libtiff5 libtiffxx5 libtimezonemap1 libtinyxml2- libtiff5-dev libtimedate-per ...