infinum android talks #04 - android lint

Post on 06-Jul-2015

206 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

Android Lint tool is a static code analysis tool that checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization. I'll show few examples and suggestions how we can use it to make application development more enjoyable.

TRANSCRIPT

Android lintNikola Kapraljević nixa

Static code analysis tool that checks your Android project source files.

lint• introduced in ADT 16 (and Tools 16)!

• scans Android project sources for potential bugs!

• available as!

• command line tool!

• integrated with Android Studio

Code scanning workflow

$ gradle lint

errors

no errors

android studio doesn’t use lint.xml

command line demo

Android Studio

Android Studio integration

configuring checks

Suppress problems

available checks• $ lint —show!

• lists all available checks!

• http://tools.android.com/tips/lint-checks

my favorites• StringFormatMatches - Ensures that the format used in <string>

definitions is compatible with the String.format call!

• MissingTranslation - Checks for incomplete translations where not all strings are translated!

• ExtraTranslation - Checks for translations that appear to be unused!

• SpUsage - Looks for uses of dp instead of sp dimensions for text sizes!

• UnusedResources - Looks for unused resources!

• HardcodedText - Looks for hardcoded text attributes which should be converted to resource lookup

links• http://tools.android.com/tips/lint!

• http://developer.android.com/tools/help/lint.html

Thank you.

top related