to be honest, pay attention to lint. The lint tool is often helpful for memory optimization, performance optimization, code specification, etc. in Android application development. After the development of each module, lint, there is an unexpected harvest.
Introduction:Static code analysis tools, no need to run, no test casesScan the entire project to analyze the following potential issues, which are categorized to indicate
problem description, problem location, and provide
reasonable suggestions for modification(This is the key ah, regardless of the wood has a big problem, look at these problems and descriptions, can also be addicted to AH): ====================================Correctness CorrectnessSecurity performance Performance Usability availability accessibility Accessibility internationalization internationalization =================================== =
1) Performance
Layout Performance (formerly Layoutopt tool, can solve useless layouts, too many nesting, too many layouts, overdraw)
Other performance (e.g., Declaration of objects at Draw/layout)
2) unused resources, lack of resources (adaptation of different resources)
3) Replacement of resources with higher performance----eg:sparsebooleanarray sparseintarray
4) Internationalization issues (hard coding)
5) Icon problem (duplicate icon, wrong size)
6) Usability issues (such as input type for non-specified text fields)
7) Error in manifest file--unregistered activity service, etc.
8) memory leaks---such as: improper use of handle.
9) The memory resources timely recovery---such as:Typedarray not recycled resources, etc.
======================================
Common commands:Lint command is located below sdk/tools/, under Tools directory, or configure SDK environment variables (configuration method: http://blog.csdn.net/rflyee/article/details/8973529)LintProject# Scan for specified itemsLint--checkcorrectness--htmlreport.html Project# Scan specified items and generate reports in HTML formatLint--help #查看帮助
How to use:1. Command. As mentioned above 2. Eclipse(1) Right button-- Android Tools > Run lint:check for Common Errors.
(2) Window > Show View > Other > Android > Lint Warnings
Configuration
partial Disable mode:
1. XML Tools:ignore Note:namespacexmlns:Tools="Http://schemas.android.com/tools"
Tools:ignore= "Unusedresources"
Tools:ignore= "Newapi,stringformatinvalid"
Tools:ignore= "All"
2. java@SuppressLint
@SuppressLint ("Newapi")
@SuppressLint ("All")
Related documents:Official Introduction:
Http://developer.android.com/tools/help/lint.html
Lint Usage Summary of Android performance optimization