Android Studio utility guide 7.1 AndroidStudio code check tool Overview

Source: Internet
Author: User

Android Studio utility guide 7.1 AndroidStudio code check tool Overview

Android Studio provides a powerful, fast, and flexible code check tool that can detect compiler and runtime errors. You are advised to correct and compile the tool before compiling.

Android Studio does not only check compilation errors, but also inefficient code. It supports code specifications, programming guidelines, and best practices, when your code contains inaccessible code, unused code, non-localized strings, unresolvable methods, memory leaks, and even spelling problems, the code analysis tools of Android Studio can be quickly checked out.

Currently, the Supported languages include Android, Java, XML, and HTML.

Android Studio integrates the code scanning tool lint, which helps you easily identify and correct Anroid code structure and quality problems. This book will focus on lint tools.

Code check can be flexibly configured

We can configure the code check rules in the preference settings, enable or disable each code check or modify its severity, and create your own configuration file,

You can perform different checks in different scopes, or disable code snippet checks.

The most common tasks covered by code check may discover errors; locate dead code; detect performance problems; improve maintainability and code structure; Be consistent with coding principles and standards; comply with specifications; how to configure Lint check

By default, all problems will be checked when the lint check is executed. Of course, we can configure the lint check to limit the problem category and severity.

We can also configure the lint Check range:

In each module project of the entire project, each test module in each product module project, each open file, each class structure, and each version control system scope

We can use the following methods to configure lint:

Configuration in Android Studio preference settings: 7.14 configure code check rules

Lint. xml file configuration: 7.17 configure lint check in Lint. xml file

Configuration in build. gradle file: 7.18 configure Lint check in Gradle

Configure lint check in Java and XML source code 7.21

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.