Investigate Google's Android Lint tool for scanning project resources for potential bugs

RESOLVED DUPLICATE of bug 1170283

Status

()

Firefox for Android
General
P4
normal
RESOLVED DUPLICATE of bug 1170283
6 years ago
3 years ago

People

(Reporter: cpeterson, Unassigned, Mentored)

Tracking

(Depends on: 1 bug)

Trunk
ARM
Android
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(fennec+)

Details

(Whiteboard: [lang=java])

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

6 years ago
Android Lint is an SDK tool which scans Android project sources for potential bugs. It is available both as a command line tool, as well as integrated with Eclipse. Here are some examples of the types of errors that it looks for:

* Missing translations (and unused translations)
* Layout performance problems (all the issues the old layoutopt tool used to find, and more)
* Unused resources
* Inconsistent array sizes (when arrays are defined in multiple configurations)
* Accessibility and internationalization problems (hardcoded strings, missing contentDescription, etc)
* Icon problems (like missing densities, duplicate icons, wrong sizes, etc)
* Usability problems (like not specifying an input type on a text field)
* Manifest errors

Fennec does not have a typical Android project structure, but I think we can lint the generated files in OBJDIR/dist/fennec or OBJDIR/mobile/android.

http://tools.android.com/tips/lint
Assignee: nobody → cpeterson
tracking-fennec: --- → +
Priority: -- → P4
(Reporter)

Updated

6 years ago
Assignee: cpeterson → nobody
Assignee: nobody → cpeterson
(Reporter)

Updated

6 years ago
Assignee: cpeterson → nobody
Created attachment 705648 [details]
Lint log

Running lint on inbound, I get 226 errors and 627 warnings. See attached log.
(Reporter)

Comment 2

5 years ago
Can you filter the "Call requires API level X (current min is Y)" errors? Calling APIs above our minimum API level is a feature, not a bug. :)
Created attachment 705661 [details]
Lint log with --disable NewApi

(In reply to Chris Peterson (:cpeterson) from comment #2)
> Can you filter the "Call requires API level X (current min is Y)" errors?
> Calling APIs above our minimum API level is a feature, not a bug. :)

Yeah, though I think the proper way to get rid of these is to annotate code with @TargetApi: http://developer.android.com/reference/android/annotation/TargetApi.html.

Calling lint with --disable NewApi hides most of the errors; log attached.
Attachment #705648 - Attachment is obsolete: true
Depends on: 834082
Depends on: 837864

Updated

4 years ago
Whiteboard: [mentor=mcomella][lang=java]
Noting that any implementation here will likely get wrapped with the work in bug 939350, which is a python lint API that will potentially be integrated with mach and/or hg.
(Assignee)

Updated

4 years ago
Mentor: michael.l.comella
Whiteboard: [mentor=mcomella][lang=java] → [lang=java]
Note that this is easy to do ad hoc in Eclipse.
Mentor: chriskitching, nalexander
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1170283
You need to log in before you can comment on or make changes to this bug.