把Eclipse(Eclipse版本必须是3.6以上)的ADT插件更新到16.0以后,发现在Eclipse菜单功能栏里多了一个红色对号的图标,如图所示:
简单使用了一下之后,发现这个工具实在确实很强大。它能够对你的Android项目进行全面分析,然后会给你一个诊断结果。告诉你的工程里有哪些不太妥当的地方,例如:
1,项目中有哪些资源文件引入了却没有在代码中使用的话,会给提示。既包括图片资源、layout文件,也有定义的String常量和Color常量等。如图:
2,layout文件中编写不规范的地方,会给出提示。例如考虑到国际化,如果直接在xml中写硬编码会提醒你把文字写到string配置文件中。如图:
3,如果把定义图片大小的变量设置为px时,会提示你不太规范,改成dp。
4,布局属性使用不当、id重复定义、标签使用不规范等,都会提示你修改。
5,考虑到屏幕适配,如果有些图片只在高分辨率中放置了,会提醒你应该在中低分辨率的文件夹下也应该放置一份。
等等....
提示的信息还有很多,都是项目代码不规范的地方,目前来看这个工具非常非常实用,对于项目打包发布前优化代码、查找没用到的资源、给apk瘦身等非常有帮助。
如果在Eclipse中查看不方便,还可以对当前项目检查导出一份html的report报告,命令如图:
效果如下:
相关推荐
Android Lint Plugin for Jenkins Parses output from the Android lint tool and displays the results for analysis. https://wiki.jenkins-ci.org/display/JENKINS/Android Lint Plugin
Android自定义Lint检查
The Android lint tool is a static code analysis tool that checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, ...
Android Lint简介和使用方法
sonar Android Lint插件
lint - 自定义lint规则
生成自定义Android lint检查并让lint警告您的代码可能正在使用Kotlin扩展或您自己的编码约定处理
危险-android_lint 基于gradle的Android项目的Lint文件。 安装 通过全球宝石 $ gem install danger-android_lint 通过邦德勒 将以下行添加到您的Gemfile中,然后运行bundle install : gem 'danger-android_lint' ...
Android Lint checks. It uses Java byte code instrumentation to collect and report performance statistics per detector for a Lint analysis invoked from Gradle. It relies on YourKit Probes to do the ...
Lin是一个让Android Lint更简单的工具
查看你的android lint风格问题。
android开发_Android自定义Lint开发示例工程
不推荐使用:适用于Jenkins的Android Lint插件 所有功能已集成到。 另请参阅: 。
anger-android_lint基于gradle的Android项目的Lint文件。 通过全局gems安装$ $ gem installanger-android_lint通过Bundler将以下行添加到您的Gemfile中,然后ruanger-android_lint基于gradle的Android项目的Lint文件...
android-lint-checks android lint检查源代码 谷歌官方的lint检测源代码
Android——Android lint工具项目资源清理 最近维护的项目已经有两年多,经过很多前辈的迭代,项目并没有变得健壮,而变得很臃肿.用Android lint工具清理了一次,清楚了不少废弃的布局和资源. 1. Android lint工具 可以...
title: 'Android 编译问题:Could not find com.android.tools.lint:lint-gradle:26.1.2.'编
为您的Android项目轻松设置CheckStyle,FindBugs,PMD和Lint
Android Lint Plugin Contributions are welcome. Join the effort ! Description This plugin enhances the Java Plugin by providing the ability to import the Android Lint reports. The idea is to ...
sonarLint 插件 供离线安装 ,用于检查代码 ,sonarLint 插件 ,用于检查代码 ,sonarLint 插件 ,用于检查代码 ,sonarLint 插件 ,用于检查代码