Droidcon Berlin 2015 - Barcamp
  • Introduction
  • Schedule
  • GDG? Never heard of it - Stefan Hoth
  • Retro Lambda - Daniel Bauer
  • Reactive API - Marcel Pintó
  • Android Template Project - Eugen Martynov
  • Put Your Acitivity on a Diet - Soundcloud/Gillaume Pedro
  • Efficiency (without dying while trying) - Sergio
  • Keystore - Patrick Dorn/Sarah Will
  • Is Your App Hackable - Kate Marshall
  • Android Data Binding - Christopher Schott / Florian Fetzer
  • Bring Your App on Every Desk - Tim
  • Intro to Android Auto - Thomas Krüger
  • Cool Apps In The Car - Ebrahim/Andreas H.
  • How to detect Your App is being uninstalled - Alek Rudy
  • What was at Google I/O? - Friedger Müffke
  • Testing Android Apps and Games Using Image Recognition - Robert Seege
  • Unholy Alliance: Cross-Plattform Dev - Jerney Nracs
  • Embracing Lollipop - Sonia Kesic
  • Feedback
  • Custom Lint Rules - Workshop
Powered by GitBook
On this page
  • Motivation
  • Objective
  • Workshop materials
  • References

Custom Lint Rules - Workshop

PreviousFeedback

Last updated 7 years ago

Motivation

Android Lint was introduced back in December 2011 [1]. Since then its IDE integration became better and better. Today Lint is the Android developer’s essential smart companion guaranteeing a good quality of all Android development assets. With the release of the most recent Android Studio version in January 2015 Lint features more than 200 default checks [2]. It checks for potential bugs, bad coding habits, broken conventions and much more.

However, several circumstances exist where it is necessary to extend the default set with custom Lint rules. This counts in particular for large projects with either a huge code base or big, distributed developer teams. Anyways, it is good practice to have additional team-, project- or company-wide conventions. But how to enforce them?

Objective

Although Lint is a fundamental part of the Android Developer Tools, the documentation on how to write custom Lint rules is rare [3] and deprecated [4]. Therefore, the objective of this workshop is to highlight the creation of custom Lint rules. It will showcase the usage of the most recent Lint API [5] and it will demonstrate how to write different types of rules (e.g. code-, resource-, project-structure-related). It will also present how to build custom rules with Gradle and even how to bundle them with your app project (which improves the integration into CI environments).

Furthermore, it will provide some insights of useful conventions in real-world scenarios we had to struggle with and where custom Lint rules saved a lot of time and money.

At the end, participants will be prepared and encouraged to write their own custom Lint rules.

Workshop materials

  • Slides:

  • Sources & examples:

References

  1. (visited 2015-05-01)

  2. (visited 2015-05-01)

  3. (visited 2015-05-01)

  4. (visited 2015-05-01)

  5. (visited 2015-05-28)

https://github.com/a11n/lint-workshop-slides
https://github.com/a11n/CustomLintRulesWorkshop
http://tools.android.com/tips/lint
http://tools.android.com/tips/lint-checks
http://tools.android.com/tips/lint/writing-a-lint-check
http://tools.android.com/tips/lint-custom-rules
https://bintray.com/android/android-tools/com.android.tools.lint.lint-api/view