Merge "docs: Added docs for lint tool. Change-Id: I06192262b56e0333bcfbcac223395788f7b0d072 Bug: 5942358" into jb-dev
diff --git a/docs/html/images/tools/lint.png b/docs/html/images/tools/lint.png
new file mode 100644
index 0000000..889e325
--- /dev/null
+++ b/docs/html/images/tools/lint.png
Binary files differ
diff --git a/docs/html/images/tools/lint_output.png b/docs/html/images/tools/lint_output.png
new file mode 100644
index 0000000..554aee7
--- /dev/null
+++ b/docs/html/images/tools/lint_output.png
Binary files differ
diff --git a/docs/html/tools/debugging/debugging-ui.jd b/docs/html/tools/debugging/debugging-ui.jd
index c1976b8..a5991ec 100644
--- a/docs/html/tools/debugging/debugging-ui.jd
+++ b/docs/html/tools/debugging/debugging-ui.jd
@@ -29,7 +29,7 @@
                 <li><a href="#overlays">Working with Pixel Perfect overlays</a></li>
             </ol>
         </li>
-        <li><a href="#layoutopt">Using layoutopt</a></li>
+        <li><a href="#lint">Using lint to optimize your UI</a></li>
       </ol>
       <h2>Related videos</h2>
           <ol>
@@ -55,15 +55,15 @@
   <p>
 Sometimes your application's layout can slow down your application.
   To help debug issues in your layout, the Android SDK provides the Hierarchy Viewer and
-  <code>layoutopt</code> tools.
+  <code>lint</code> tools.
   </p>
 
   <p>The Hierarchy Viewer application allows you to debug and optimize your user interface. It
   provides a visual representation of the layout's View hierarchy (the View Hierarchy window)
   and a magnified view of the display (the Pixel Perfect window).</p>
 
-  <p><code>layoutopt</code> is a command-line tool that helps you optimize the layouts and layout
-  hierarchies of your applications. You can run it against your layout files or resource
+  <p>Android <code>lint</code> is a static code scanning tool that helps you optimize the layouts and layout
+  hierarchies of your applications, as well as detect other common coding problems. You can run it against your layout files or resource
   directories to quickly check for inefficiencies or other types of problems that could be
   affecting the performance of your application.</p>
 
@@ -491,57 +491,7 @@
         alt=""
         height="600"/>
 <p class="img-caption"><strong>Figure 4.</strong> The Pixel Perfect window</p>
-<h2 id="layoutopt">Using layoutopt</h2>
-<p>
-    The <code>layoutopt</code> tool lets you analyze the XML files that define your
-    application's UI to find inefficiencies in the view hierarchy.</p>
-
-<p>
-    To run the tool, open a terminal and launch <code>layoutopt &lt;xmlfiles&gt;</code>
-    from your SDK <code>tools/</code> directory. The &lt;xmlfiles&gt; argument is a space-
-    delimited list of resources you want to analyze, either uncompiled resource xml files or
-    directories of such files.
-</p>
-<p>
-    The tool loads the specified XML files and analyzes their definitions and
-    hierarchies according to a set of predefined rules. For every issue it detects, it
-    displays the following information:
-</p>
-<ul>
-    <li>
-        The filename in which the issue was detected.
-    </li>
-    <li>
-        The line number for the issue.
-    </li>
-    <li>
-        A description of the issue, and for some types of issues it also suggests a resolution.
-    </li>
-</ul>
-<p>The following is a sample of the output from the tool:</p>
-<pre>
-$ layoutopt samples/
-samples/compound.xml
-   7:23 The root-level &lt;FrameLayout/&gt; can be replaced with &lt;merge/&gt;
-   11:21 This LinearLayout layout or its FrameLayout parent is useless
-samples/simple.xml
-   7:7 The root-level &lt;FrameLayout/&gt; can be replaced with &lt;merge/&gt;
-samples/too_deep.xml
-   -1:-1 This layout has too many nested layouts: 13 levels, it should have &lt;= 10!
-   20:81 This LinearLayout layout or its LinearLayout parent is useless
-   24:79 This LinearLayout layout or its LinearLayout parent is useless
-   28:77 This LinearLayout layout or its LinearLayout parent is useless
-   32:75 This LinearLayout layout or its LinearLayout parent is useless
-   36:73 This LinearLayout layout or its LinearLayout parent is useless
-   40:71 This LinearLayout layout or its LinearLayout parent is useless
-   44:69 This LinearLayout layout or its LinearLayout parent is useless
-   48:67 This LinearLayout layout or its LinearLayout parent is useless
-   52:65 This LinearLayout layout or its LinearLayout parent is useless
-   56:63 This LinearLayout layout or its LinearLayout parent is useless
-samples/too_many.xml
-   7:413 The root-level &lt;FrameLayout/&gt; can be replaced with &lt;merge/&gt;
-   -1:-1 This layout has too many views: 81 views, it should have &lt;= 80!
-samples/useless.xml
-   7:19 The root-level &lt;FrameLayout/&gt; can be replaced with &lt;merge/&gt;
-   11:17 This LinearLayout layout or its FrameLayout parent is useless
-</pre>
+<h2 id="lint">Using lint to Optimize Your UI</h2>
+<p>The Android {@code lint} tool lets you analyze the XML files that define your application's UI to find inefficiencies in the view hierarchy.</p>
+<p class="note"><strong>Note: </strong>The Android <code>layoutopt</code> tool has been replaced by the {@code lint} tool beginning in ADT and SDK Tools revision 16. The {@code lint} tool reports UI layout performance issues in a similar way as <code>layoutopt</code>, and detects additional problems.</p>
+<p>For more information about using {@code lint}, see <a href="{@docRoot}tools/debugging/improving-w-lint.html">Improving Your Code with lint</a> and the <a  href="{@docRoot}tools/help/lint.html">lint reference documentation</a>.</p>
diff --git a/docs/html/tools/debugging/improving-w-lint.jd b/docs/html/tools/debugging/improving-w-lint.jd
new file mode 100644
index 0000000..7e238fa
--- /dev/null
+++ b/docs/html/tools/debugging/improving-w-lint.jd
@@ -0,0 +1,219 @@
+page.title=Improving Your Code with lint
+parent.title=Debugging
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+    <div id="qv">
+      <h2>In This Document</h2>
+
+      <ol>
+        <li><a href="#overview">Overview</a></li>
+        <li><a href=#eclipse">Running lint from Eclipse</a></li>
+        <li><a href=#commandline">Running lint from the command-line</a></li>
+         <li><a href=#config">Configuring lint</a>
+            <ol>
+		<LI><a href="#eclipse_config">Configuring lint in Eclipse</a></LI>
+                <LI><a href="#pref">Configuring the lint file</a></LI>
+                <LI><a href="#src">Configuring lint checking in Java and XML source files</a></LI>
+            </ol>
+         </li>
+      </ol>
+      <h2>See Also</h2>
+          <ol>
+              <li><a href="{@docRoot}tools/help/lint.html">lint (reference)</a></li>
+          </ol>
+    </div>
+</div>
+
+
+<p>
+In addition to testing that your Android application meets its functional requirements, it's important to ensure that your code has no structural problems. Poorly structured code can impact the reliability and efficiency of your Android apps and make your code harder to maintain. For example, if your XML resource files contain unused namespaces, this takes up space and incurs unnecessary processing. Other structural issues, such as use of deprecated elements or API calls that are not supported by the target API versions, might lead to code failing to run correctly.</p>
+
+<h2 id="overview">Overview</h2>
+<p>The Android SDK provides a code scanning tool called {@code lint} that can help you to easily identify and correct problems with the structural quality of your code, without having to execute the app or write any test cases. Each problem detected by the tool is reported with a description message and a severity level, so that you can quickly prioritize the critical improvements that need to be made.  You can also configure a problem's severity level to ignore issues that are not relevant for your project, or raise the severity level. The tool has a command-line interface, so you can easily integrate it into your automated testing process.</p>
+<p>The {@code lint} tool checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization. You can run {@code lint} from the command-line or from the Eclipse environment.</p>
+<p>Figure 1 shows how the {@code lint} tool processes the application source files.</p>
+<img id="Fig1" src="{@docRoot}images/tools/lint.png" alt="">
+<p class="img-caption"><strong>Figure 1.</strong> Code scanning workflow with the {@code lint} tool</p>
+<dl>
+<dt><b>Application source files</b></dt>
+<dd>The source files consist of files that make up your Android project, including Java and XML files, icons, and ProGuard configuration files. </dd>
+<dt><b>The <code>lint.xml</code> file</b></dt>
+<dd>A configuration file that you can use to specify any {@code lint} checks that you want to exclude and to customize problem severity levels.</dd>
+<dt><b>The {@code lint} tool</b></dt>
+<dd>A static code scanning tool that you can run on your Android project from the command-line or from Eclipse.   The {@code lint} tool checks for structural code problems that could affect the quality and performance of your Android application. It is strongly recommended that you correct any errors that {@code lint} detects before publishing your application.</dd>
+<dt><b>Results of {@code lint} checking</b></dt>
+<dd>You can view the results from {@code lint} in the console or in the <strong>Lint Warnings</strong> view in Eclipse.  Each issue is identified by the location in the source files where it occurred and a description of the issue.</dd>
+</dl>
+<p>The {@code lint} tool is automatically installed as part of the Android SDK Tools revision 16 or higher. If you want to use {@code lint} in the Eclipse environment, you must also install the Android Development Tools (ADT) Plugin for Eclipse revision 16 or higher. For more information about installing the SDK or the ADT Plugin for Eclipse, see <a href="http://developer.android.com/sdk/installing.html">Installing the SDK.</a></p>
+
+<h2 id="eclipse">Running lint from Eclipse</h2>
+<p>If the ADT Plugin is installed in your Eclipse environment, the {@code lint} tool runs automatically when you perform one of these actions:</p>
+<ul>
+<LI>Export an APK</LI>
+<LI>Edit and save an XML source file in your Android project (such as a manifest or layout file)</LI>
+<LI>Use the layout editor in Eclipse to make changes</LI>
+</ul>
+<p>Note that when you export an APK, {@code lint} only runs an automatic check for fatal errors and aborts the export if fatal errors are found. You can turn off this automatic checking from the <strong>Lint Error Checking</strong> page in Eclipse Preferences. </p>
+<p>The output is displayed in the <strong>Lint Warnings</strong> view. If the <strong>Lint Warnings</strong> view is not showing in the workbench, you can bring it up from the Eclipse menu by clicking <strong>Window &gt; Show View &gt; Other &gt;  Android &gt; Lint Warnings</strong>.</p>
+<p>Figure 2 shows an example of the output in the Lint Warnings view.</p>
+<img id="Fig2" src="{@docRoot}images/tools/lint_output.png" alt="">
+<p class="img-caption"><strong>Figure 2.</strong> Sample output in the <strong>Lint Warnings</strong> view</p>
+<p>You can also run a {@code lint} scan manually on your Android project in Eclipse by right-clicking on the project folder in the Package Explorer > <strong>Android Tools  &gt; Run Lint: Check for Common Errors</strong>.</p>
+
+
+<h2 id="commandline">Running lint from the Command-Line</h2>
+<p>
+To run {@code lint} against a list of files in a project directory:
+<pre>lint [flags] &lt;project directory&gt;</pre>
+<p>For example, you can issue the following command to scan the files under the {@code myproject} directory and its subdirectories. The issue ID  <code>MissingPrefix</code> tells {@code lint} to only scan for XML attributes that are missing the Android namespace prefix.</p>
+<pre>lint --check MissingPrefix myproject </pre>
+<p>To see the full list of flags and command-line arguments supported by the tool:</p>
+<pre>lint --help</pre>
+</p>
+
+<h3>Example lint output</h3>
+<p>The following example shows the console output when the {@code lint} command is run against a project called Earthquake.  </p>
+<pre>
+$ lint Earthquake
+
+Scanning Earthquake: ...............................................................................................................................
+Scanning Earthquake (Phase 2): .......
+AndroidManifest.xml:23: Warning: &lt;uses-sdk&gt; tag appears after &lt;application&gt; tag [ManifestOrder]
+  &lt;uses-sdk android:minSdkVersion="7" /&gt;
+  ^
+AndroidManifest.xml:23: Warning: &lt;uses-sdk&gt; tag should specify a target API level (the highest verified version; when running on later versions, compatibility behaviors may be enabled) with android:targetSdkVersion="?" [UsesMinSdkAttributes]
+  &lt;uses-sdk android:minSdkVersion="7" /&gt;
+  ^
+res/layout/preferences.xml: Warning: The resource R.layout.preferences appears to be unused [UnusedResources]
+res: Warning: Missing density variation folders in res: drawable-xhdpi [IconMissingDensityFolder]
+0 errors, 4 warnings
+</pre>
+<p>The output above lists four warnings and no errors in this project.  Three warnings ({@code ManifestOrder}, {@code UsesMinSdkAttributes}, and {@code UsesMinSdkAttributes}) were found in the project's <code>AndroidManifest.xml</code> file. The remaining warning ({@code IconMissingDensityFolder}) was found in the <code>Preferences.xml</code> layout file.</p>
+
+<h2 id="config">Configuring lint</h2>
+<p>By default, when you run a {@code lint} scan, the tool checks for all issues that are supported by {@code lint}.  You can also restrict the issues for {@code lint} to check and assign the severity level for those issues. For example, you can disable {@code lint} checking for specific issues that are not relevant to your project and configure {@code lint} to report non-critical issues at a lower severity level.</p>
+<p>You can configure {@code lint} checking at different levels:</p>
+<ul>
+<LI>Globally, for all projects</LI>
+<li>Per project</li>
+<li>Per file</li>
+<li>Per Java class or method (by using the <code>&#64;SuppressLint</code> annotation), or per XML element (by using the <code>tools:ignore</code> attribute.</li>
+</ul>
+
+<h3 id="eclipse_config">Configuring lint in Eclipse</h3>
+<p>You can configure global, project-specific, and file-specific settings for {@code lint} from the Eclipse user interface.</p>
+
+<h4>Global preferences</h4>
+<ol>
+<LI>Open <strong>Window  &gt; Preferences  &gt; Android  &gt; Lint Error Checking</strong>.</LI>
+<li>Specify your preferences and click <b>OK</b>.</li>
+</ol>
+<p>These settings are applied by default when you run {@code lint} on your Android projects in Eclipse.</p>
+
+<h4>Project and file-specific preferences</h4>
+<ol>
+<LI>Run the {@code lint} tool on your project by right-clicking on your project folder in the Package Explorer and selecting  <strong>Android Tools &gt; Run Lint: Check for Common Errors</strong>. This action brings up the <strong>Lint Warnings</strong> view which displays a list of issues that {@code lint} detected in your project.</LI>
+<li>From the <strong>Lint Warnings</strong> view, use the toolbar options to configure {@code lint} preferences for individual projects and files in Eclipse. The options you can select include:
+<ul>
+<LI><b>Suppress this error with an annotation/attribute</b> - If the issue appears in a Java class, the {@code lint} tool adds a <code>&#64;SuppressLint</code> annotation to the method where the issue was detected.  If the issue appears in an {@code .xml} file, {@code lint} inserts a <code>tools:ignore</code> attribute to disable checking for the {@code lint} issue in this file.</LI>
+<LI><b>Ignore in this file</b> - Disables checking for this {@code lint} issue in this file.</LI>
+<li><b>Ignore in this project</b>  - Disables checking for this {@code lint} issue in this project.</li>
+<li><b>Always ignore</b> - Disables checking for this {@code lint} issue globally for all projects.</li>
+</ul>
+</li>
+</ol>
+<p>If you select the second or third option, the {@code lint} tool automatically generates a <code>lint.xml</code> file with these configuration settings in your Android application project folder.  </p>
+
+<h3 id="pref">Configuring the lint file</h3>
+<p>You can specify your {@code lint} checking preferences in the <code>lint.xml</code> file.  If you are creating this file manually, place it in the root directory of your Android project.  If you are configuring {@code lint} preferences in Eclipse, the <code>lint.xml</code> file is automatically created and added to your Android project for you.</p>
+<p>The <code>lint.xml</code> file consists of an enclosing <code>&lt;lint&gt;</code> parent tag that contains one or more children <code>&lt;issue&gt;</code> elements.  Each <code>&lt;issue&gt;</code> is identified by a unique <code>id</code> attribute value, which is defined by {@code lint}.</p>
+<pre>
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+    &lt;lint&gt;
+        &lt;!-- list of issues to configure --&gt;
+&lt;/lint&gt;
+</pre>
+<p>By setting the severity attribute value in the <code>&lt;issue&gt;</code> tag, you can disable {@code lint} checking for an issue or change the severity level for an issue.  </p>
+<p class="note"><strong>Tip: </strong>To see the full list of issues supported by the {@code lint} tool and their corresponding issue IDs, run the <code>lint --list</code> command.</p>
+
+<h4>Sample lint.xml file</h4>
+<p>The following example shows the contents of a <code>lint.xml</code> file.</p>
+<pre>
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;lint&gt;
+    &lt;!-- Disable the given check in this project --&gt;
+    &lt;issue id="IconMissingDensityFolder" severity="ignore" /&gt;
+
+    &lt;!-- Ignore the ObsoleteLayoutParam issue in the specified files --&gt;
+    &lt;issue id="ObsoleteLayoutParam"&gt;
+        &lt;ignore path="res/layout/activation.xml" /&gt;
+        &lt;ignore path="res/layout-xlarge/activation.xml" /&gt;
+    &lt;/issue>
+
+    &lt;!-- Ignore the UselessLeaf issue in the specified file --&gt;
+    &lt;issue id="UselessLeaf"&gt;
+        &lt;ignore path="res/layout/main.xml" /&gt;
+    &lt;/issue&gt;
+
+    &lt;!-- Change the severity of hardcoded strings to "error" --&gt;
+    &lt;issue id="HardcodedText" severity="error" /&gt;
+&lt;/lint&gt;
+</pre>
+
+<h3 id="src">Configuring lint checking in Java and XML source files</h3>
+<p>You can disable {@code lint} checking from your Java and XML source files.</p>
+
+<p class="note"><strong>Tip: </strong>If you are using Eclipse, you can use the <strong>Quick Fix</strong> feature to automatically add the annotation or attribute to disable {@code lint} checking to your Java or XML source files:
+<ol>
+<LI>Open the Java or XML file that has a {@code lint} warning or error in an Eclipse editor.</LI>
+<LI>Move your cursor to the location in the file where is {@code lint} issue is found, then press <code>Ctrl+1</code> to bring up the <strong>Quick Fix</strong> pop-up.</LI>
+<li>From the <strong>Quick Fix</strong> pop-up, select the action to add an annotation or attribute to ignore the {@code lint} issue.</li>
+</ol>
+</p>
+
+<h4>Configuring lint checking in Java</h4>
+<p>To disable {@code lint} checking specifically for a Java class or method in your Android project, add the <code>&#64;SuppressLint</code> annotation to that Java code. </p>
+<p>The following example shows how you can turn off {@code lint} checking for the {@code NewApi} issue in the <code>onCreate</code> method.  The {@code lint} tool continues to check for the {@code NewApi} issue in other methods of this class.</p>
+<pre>
+&#64;SuppressLint("NewApi")
+&#64;Override
+public void onCreate(Bundle savedInstanceState) {
+    super.onCreate(savedInstanceState);
+    setContentView(R.layout.main);
+</pre>
+<p>The following example shows how to turn off {@code lint} checking for the {@code ParserError} issue in the <code>FeedProvider</code> class:</p>
+<pre>
+&#64;SuppressLint("ParserError")
+public class FeedProvider extends ContentProvider {
+</pre>
+<p>To suppress checking for all {@code lint} issues in the Java file, use the {@code all} keyword, like this:</p>
+<pre>
+&#64;SuppressLint("all")
+</pre>
+
+<h4>Configuring lint checking in XML</h4>
+<p>You can use the <code>tools:ignore</code> attribute to disable {@code lint} checking for specific sections of your XML files.  In order for this attribute to be recognized by the {@code lint} tool, the following namespace value must be included in your XML file:</p>
+<pre>
+namespace xmlns:tools="http://schemas.android.com/tools"
+</pre>
+<p>The following example shows how you can turn off {@code lint} checking for the  {@code UnusedResources} issue for the <code>&lt;LinearLayout&gt;</code> element of an XML layout file.  The <code>ignore</code> attribute is inherited by the children elements of the parent element in which the attribute is declared. In this example, the {@code lint} check is also disabled for the child <code>&lt;TextView&gt;</code> element. </p>
+<pre>
+&lt;LinearLayout 
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    tools:ignore="UnusedResources" &gt;
+
+    &lt;TextView
+        android:text="&#64;string/auto_update_prompt" /&gt;
+&lt;/LinearLayout&gt;
+</pre>
+<p>To disable more than one issue, list the issues to disable in a comma-separated string.  For example:</p>
+<pre>
+tools:ignore="NewApi,StringFormatInvalid"
+</pre>
+<p>To suppress checking for all {@code lint} issues in the XML element, use the {@code all} keyword, like this:</p>
+<pre>
+tools:ignore="all"
+</pre>
diff --git a/docs/html/tools/help/lint.jd b/docs/html/tools/help/lint.jd
new file mode 100644
index 0000000..ba31f6d
--- /dev/null
+++ b/docs/html/tools/help/lint.jd
@@ -0,0 +1,178 @@
+page.title=lint
+parent.title=Tools
+parent.link=index.html
+@jd:body
+
+<div id="qv-wrapper">
+  <div id="qv">
+     <h2>In this document</h2>
+  <ol>
+     <li><a href="#syntax">Syntax</a></li>
+     <li><a href="#options">Options</a></li>
+     <li><a href="#config_keywords">Configuring Java and XML Source Files</a></li>
+  </ol>
+  </div>
+</div>
+
+<p>The Android {@code 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. </p>
+<p>For more information on running {@code lint}, see <a href="{@docRoot}tools/debugging/improving-w-lint.html">Improving Your Code with lint</a>.</p>
+
+<h2 id="syntax">Syntax</h2>
+<p>
+<pre>lint [flags] &lt;project directory&gt;</pre>
+
+For example, you can issue the following command to scan the Java and XML files under the {@code myproject}  directory and its subdirectories. The result is displayed on the console.
+<pre>lint myproject</pre>
+
+You can also use {@code lint} to check for a specific issue. For example, you can run the following command to scan the files under the {@code myproject} directory and its subdirectories to check for XML attributes missing the Android namespace prefix. The issue ID {@code MissingPrefix} tells lint to only scan for this issue.
+<pre>lint --check MissingPrefix myproject</pre>
+
+You can create an HTML report for the issues that {@code lint} detects. For example, you can run the following command to scan the {@code myproject} directory and its subdirectories for accessibility issues, then generate an HTML report in the {@code accessibility_report.html} file.
+<pre>lint --check Accessibility --HTML accessibility_report.html myproject</pre>
+</p>
+
+<h2 id="options">Options</h2>
+<p>Table 1 describes the command-line options for {@code lint}.</p>
+<p class="table-caption" id="table1">
+  <strong>Table 1.</strong> Command-line options for lint</p>
+<table>
+<tr>
+  <th>Category</th>
+  <th>Option</th>
+  <th>Description</th>
+  <th>Comments</th>
+</tr>
+
+<tr>
+<td rowspan="7">Checking</td>
+<td><nobr><code>--disable &lt;list&gt;</code></nobr></td>
+<td>Disable checking for a specific list of issues.</td>
+<td>The <code>&lt;list&gt;</code> must be a comma-separated list of {@code lint} issue IDs or categories.</td>
+</tr>
+
+<tr>
+<td><nobr><code>--enable &lt;list&gt;</code></nobr></td>
+<td>Check for all the default issues supported by {@code lint} as well as the specifically enabled list of issues.</td>
+<td>The <code>&lt;list&gt;</code> must be a comma-separated list of {@code lint} issue IDs or categories.</td>
+</tr>
+
+<tr>
+<td><nobr><code>--check &lt;list&gt;</code></nobr></td>
+<td>Check for a specific list of issues.</td>
+<td>The <code>&lt;list&gt;</code> must be a comma-separated list of {@code lint} issue IDs or categories.</td>
+</tr>
+
+<tr>
+<td><nobr><code>-w</code> or <code>--nowarn</code></nobr></td>
+<td>Only check for errors and ignore warnings</td>
+<td>&nbsp;</td>
+</tr>
+
+<tr>
+<td><nobr><code>-Wall</code></nobr></td>
+<td>Check for all warnings, including those that are disabled by default</td>
+<td>&nbsp;</td>
+</tr>
+
+<tr>
+<td><nobr><code>-Werror</code></nobr></td>
+<td>Report all warnings as errors</td>
+<td>&nbsp;</td>
+</tr>
+
+<tr>
+<td><nobr><code>--config &lt;filename&gt;</code></nobr></td>
+<td>Use the specified configuration file to determine if issues are enabled or disabled for {@code lint} checking</td>
+<td>If the project contains a {@code lint.xml} file, the {@code lint.xml} file will be used as the configuration file by default.</td>
+</tr>
+
+<tr>
+<td rowspan="9">Reporting</td>
+<td><nobr><code>--html &lt;filename&gt;</code></nobr></td>
+<td>Generate an HTML report.</td>
+<td>The report is saved in the output file specified in the argument. The HTML output includes code snippets of the source code where {@code lint} detected an issue, a verbose description of the issue found, and links to the source file.</td>
+</tr>
+
+<tr>
+<td><nobr><code>--url &lt;filepath&gt;=&lt;url&gt;</code></nobr></td>
+<td>In the HTML output, replace a local path prefix <code>&lt;filepath&gt;</code> with a url prefix <code>&lt;url&gt;</code>.</td>
+<td>The {@code --url} option only applies when you are generating an HTML report with the {@code --html} option. You can specify multiple &lt;filepath&gt;=&lt;url&gt; mappings in the argument by separating each mapping with a comma.<p>To turn off linking to files, use {@code --url none}</p></td>
+</tr>
+
+<tr>
+<td><nobr><code>--simplehtml &lt;filename&gt;</code></nobr></td>
+<td>Generate a simple HTML report</td>
+<td>The report is saved in the output file specified in the argument.</td>
+</tr>
+
+<tr>
+<td><nobr><code>--xml &lt;filename&gt;</code></nobr></td>
+<td>Generate an XML report</td>
+<td>The report is saved in the output file specified in the argument.</td>
+</tr>
+
+<tr>
+<td><nobr><code>--fullpath</code></nobr></td>
+<td>Show the full file paths in the {@code lint} checking results.</td>
+<td>&nbsp;</td>
+</tr>
+
+<tr>
+<td><nobr><code>--showall</code></nobr></td>
+<td>Don't truncate long messages or lists of alternate locations.</td>
+<td>&nbsp;</td>
+</tr>
+
+<tr>
+<td><nobr><code>--nolines</code></nobr></td>
+<td>Don't include code snippets from the source files in the output.</td>
+<td>&nbsp;</td>
+</tr>
+
+<tr>
+<td><nobr><code>--exitcode</code></nobr></td>
+<td>Set the exit code to 1 if errors are found.</td>
+<td>&nbsp;</td>
+</tr>
+
+<tr>
+<td><nobr><code>--quiet</code></nobr></td>
+<td>Don't show the progress indicator.</td>
+<td>&nbsp;</td>
+</tr>
+
+<tr>
+<td rowspan="4">Help</td>
+<td><nobr><code>--help</code></nobr></td>
+<td>List the command-line arguments supported by the {@code lint} tool.</td>
+<td>Use {@code --help &lt;topic&gt;} to see help information for a specific topic, such as "suppress".</td>
+</tr>
+
+<tr>
+<td><nobr><code>--list</code></nobr></td>
+<td>List the ID and short description for issues that can be checked by {@code lint}</td>
+<td>&nbsp;</td>
+</tr>
+
+<tr>
+<td><nobr><code>--show</code></nobr></td>
+<td>List the ID and verbose description for issues that can be checked by {@code lint}</td>
+<td>Use {@code --show &lt;ids&gt;} to see descriptions for a specific list of {@code lint} issue IDs.</td>
+</tr>
+
+<tr>
+<td><nobr><code>--version</code></nobr></td>
+<td>Show the {@code lint} version</td>
+<td>&nbsp;</td>
+</tr>
+
+</table>
+
+
+<h2 id="config_keywords">Configuring Java and XML Source Files</h2>
+<p>To configure lint checking, you can apply the following annotation or attribute to the source files in your Android project. </p>
+<ul>
+<LI>To disable lint checking for a specific Java class or method, use the <code>@SuppressLint</code> annotation. </LI>
+<li>To disable lint checking for specific sections of your XML file, use the <code>tools:ignore</code> attribute. </li>
+</ul>
+<p>You can also specify your lint checking preferences for a specific Android project in the lint.xml file.  For more information on configuring lint, see <a href="{@docRoot}tools/debugging/improving-w-lint.html">Improving Your Code with lint</a>.</p>
diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs
index c7cdded..850e0ec 100644
--- a/docs/html/tools/tools_toc.cs
+++ b/docs/html/tools/tools_toc.cs
@@ -107,6 +107,7 @@
       <li><a href="<?cs var:toroot ?>tools/debugging/debugging-projects-cmdline.html"><span class="en">From Other IDEs</span></a></li>
       <li><a href="<?cs var:toroot ?>tools/debugging/ddms.html"><span class="en">Using DDMS</span></a></li>
       <li><a href="<?cs var:toroot ?>tools/debugging/debugging-log.html"><span class="en">Reading and Writing Logs</span></a></li>
+      <li><a href="<?cs var:toroot ?>tools/debugging/improving-w-lint.html"><span class="en">Improving Your Code with lint</span></a></li>
       <li><a href="<?cs var:toroot ?>tools/debugging/debugging-ui.html"><span class="en">Optimizing your UI</span></a></li>
       <li><a href="<?cs var:toroot ?>tools/debugging/debugging-tracing.html"><span class="en">Profiling with Traceview and dmtracedump</span></a></li>
       <li><a href="<?cs var:toroot ?>tools/debugging/debugging-devtools.html"><span class="en">Using the Dev Tools App</span></a></li>
@@ -137,7 +138,7 @@
       <li><a href="<?cs var:toroot ?>tools/help/etc1tool.html">etc1tool</a></li>
       <li><a href="<?cs var:toroot ?>tools/help/hierarchy-viewer.html">Hierarchy Viewer</a></li>
       <li><a href="<?cs var:toroot ?>tools/help/hprof-conv.html">hprof-conv</a></li>
-      <li><a href="<?cs var:toroot ?>tools/help/layoutopt.html">layoutopt</a></li>
+      <li><a href="<?cs var:toroot ?>tools/help/lint.html">lint</span></a></li>
       <li><a href="<?cs var:toroot ?>tools/help/logcat.html">logcat</a></li>
       <li><a href="<?cs var:toroot ?>tools/help/mksdcard.html">mksdcard</a></li>
       <li><a href="<?cs var:toroot ?>tools/help/monkey.html">monkey</a></li>