Android code optimization tool-Android lint

Source: Internet
Author: User

 

As a mobile app developer, we always hope that the smaller the apk file to be released, the better. We do not want image resources that are not used by resource files to be packaged into the apk, lint can solve these problems if you do not want the app to use APIs higher than minSdk or the AndroidManifest file to have exceptions. Android lint is a new tool provided in ADT 16. It is a code scanning tool that helps us identify problems with the code structure, including:

 

1) Layout performance (previously layoutopt tool, which can solve useless layout, too many nesting, and too many layoutopt)

2) unused resources

3) Inconsistent array size

4) internationalization issues (hard coding)

5) icon problems (duplicate icon, incorrect size)

6) availability issues (for example, input type of unspecified text fields)

7) manifest file Error

 

Android lint can solve the above problems. Of course there are more. For details, refer to Android Lint Checks. Android officials also summarized the problems that lint can solve, such.

 

Lint is a command tool that has been perfectly integrated into Eclipse and can be easily used. Through lint, we can detect the description of each problem and the severity of the problem, and improve the program according to the detection report. The following describes how to use lint in Eclipse.

 

There are two ways to use lint: Click the hook button in the upper-left corner of Eclipse or choose Project> right-click> Android Tools, as shown in:

Figure 1 Figure 2

 

The lint tool is simple, practical, and can be used for automated analysis. After the analysis is complete, the following analysis reports are provided:

 

The analysis includes errors and warnings. specific descriptions, categories, and locations are provided. It is an error description and provides a warning description.

 

 

Android lint is a helpful tool for android Developers. It is very helpful for optimizing code before project packaging and publishing, searching for useless resources, and searching for errors. As one of the tools that developers must master, if you want to learn more, refer to lint.

 

 

 

 

Let's talk about some other things. I hope you can pass by. The blogger is lucky enough to be one of the candidates for the 2013 blog star. I look forward to your vote. Thank you for your support.

 

Vote:

Http://vote.blog.csdn.net/blogstaritem/blogstar2013/xyz_lmn


 

 

/*** @ Author Zhang xingye * http://blog.csdn.net/xyz_lmn* iOS entry group: 83702688
* Android Development Group: 241395671 * my Sina Weibo: @ Zhang xingye TBOW*/

 

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.