The article directories

  • A, use,
  • Type of Lint problem
  • Check by rule name
    • Remove unnecessary resources, etc

The official documentation reads: Improved code through Lint checking

A, use,



When the results come out

Type of Lint problem

The problems can be divided into the following categories:

  1. Accessibility Accessibility options such as the ImageView contentDescription are often recommended to be defined in properties.
  2. Compliance, which is a violation of Google Play’s requirements, such as using out-of-date library versions, performance, security, AND API levels that do not follow the new system’s requirements, etc.
  3. Jacked-up coding, e.g. hard coding, use of outdated API, etc.
  4. Internationalization, direct use of Chinese characters without using resource references, etc
  5. Interoperability, like Interoperability with Kotln.
  6. Performanc Encoding that affects performance, e.g., static references, circular references, etc
  7. Insecure encoding, such as allowing JavaScriptInterface in webViews
  8. Usability, there are better alternatives such as typography, icon formatting suggestions,.png, etc

Check by rule name

Remove unnecessary resources, etc

1. Sometimes we need to explicitly check for a certain type of problem, such as finding unused resources in a project and removing them, which can consume performance. You can find these unused resources By clicking Analyze > Run Inspection By Name. A dialog box will pop up





We chooseunused resources, will list all unused resources, select a specific one, click on the left small bulb, selectRemove All Unused ResourcesYou can delete all unused resources



2. You can also get rid of useless introductionsunused import, select one or more, and click on the rightDelete unnecessary import



3,unused assignmentIf it is useless assignment, you can select more than one, and then batch remove the extra assignment



4,unused declarationUseless statement