Android LINT (powerful tool for code optimization)

Source: Internet
Author: User

After the ADT plug-in of eclipse is updated to the latest 16.0, it is found that there is a red check mark icon in the eclipse function bar ,:

After being simple and practical, I found that this tool is too powerful.

It can perform a comprehensive analysis on your android project and then give you a diagnostic result.

Tell your project what is inappropriate, such:

1. Which resource files are introduced in the project but not in CodeIf it is used in, a prompt is displayed. Including image resources, layout files, and defined string constants and color constants.


2. If the layout file is written incorrectly, a prompt is displayed. For example, if you write Chinese characters directly in XML, you will be reminded to write the text to the string configuration file. For exampleFigure:

3. If you set the variable defining the image size to PX, you will be prompted to change it to DP, which is not standard.4. You will be prompted to modify the layout attributes, duplicate ID definitions, and nonstandard tag usage.5. Considering screen adaptation, if some images are only placed in high resolution, you will be reminded to place a copy in a folder with medium or low resolution.......There are still a lot of prompts, which are where the project code is not standard. Currently, this tool is very practical, it is very helpful for optimizing code, finding useless resources, and slimming APK before project packaging and publishing.

If it is inconvenient to view in eclipse, you can also check the current project and export an HTML report,

For more information, see the official website: http://tools.android.com/tips/lint

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: info-contact@alibabacloud.com 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.