You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/html/tools/debugging/debugging-ui.jd
+8-58Lines changed: 8 additions & 58 deletions
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ parent.link=index.html
29
29
<li><a href="#overlays">Working with Pixel Perfect overlays</a></li>
30
30
</ol>
31
31
</li>
32
-
<li><a href="#layoutopt">Using layoutopt</a></li>
32
+
<li><a href="#lint">Using lint to optimize your UI</a></li>
33
33
</ol>
34
34
<h2>Related videos</h2>
35
35
<ol>
@@ -55,15 +55,15 @@ parent.link=index.html
55
55
<p>
56
56
Sometimes your application's layout can slow down your application.
57
57
To help debug issues in your layout, the Android SDK provides the Hierarchy Viewer and
58
-
<code>layoutopt</code> tools.
58
+
<code>lint</code> tools.
59
59
</p>
60
60
61
61
<p>The Hierarchy Viewer application allows you to debug and optimize your user interface. It
62
62
provides a visual representation of the layout's View hierarchy (the View Hierarchy window)
63
63
and a magnified view of the display (the Pixel Perfect window).</p>
64
64
65
-
<p><code>layoutopt</code> is a command-line tool that helps you optimize the layouts and layout
66
-
hierarchies of your applications. You can run it against your layout files or resource
65
+
<p>Android <code>lint</code> is a static code scanning tool that helps you optimize the layouts and layout
66
+
hierarchies of your applications, as well as detect other common coding problems. You can run it against your layout files or resource
67
67
directories to quickly check for inefficiencies or other types of problems that could be
68
68
affecting the performance of your application.</p>
69
69
@@ -491,57 +491,7 @@ Sometimes your application's layout can slow down your application.
491
491
alt=""
492
492
height="600"/>
493
493
<p class="img-caption"><strong>Figure 4.</strong> The Pixel Perfect window</p>
494
-
<h2 id="layoutopt">Using layoutopt</h2>
495
-
<p>
496
-
The <code>layoutopt</code> tool lets you analyze the XML files that define your
497
-
application's UI to find inefficiencies in the view hierarchy.</p>
498
-
499
-
<p>
500
-
To run the tool, open a terminal and launch <code>layoutopt <xmlfiles></code>
501
-
from your SDK <code>tools/</code> directory. The <xmlfiles> argument is a space-
502
-
delimited list of resources you want to analyze, either uncompiled resource xml files or
503
-
directories of such files.
504
-
</p>
505
-
<p>
506
-
The tool loads the specified XML files and analyzes their definitions and
507
-
hierarchies according to a set of predefined rules. For every issue it detects, it
508
-
displays the following information:
509
-
</p>
510
-
<ul>
511
-
<li>
512
-
The filename in which the issue was detected.
513
-
</li>
514
-
<li>
515
-
The line number for the issue.
516
-
</li>
517
-
<li>
518
-
A description of the issue, and for some types of issues it also suggests a resolution.
519
-
</li>
520
-
</ul>
521
-
<p>The following is a sample of the output from the tool:</p>
522
-
<pre>
523
-
$ layoutopt samples/
524
-
samples/compound.xml
525
-
7:23 The root-level <FrameLayout/> can be replaced with <merge/>
526
-
11:21 This LinearLayout layout or its FrameLayout parent is useless
527
-
samples/simple.xml
528
-
7:7 The root-level <FrameLayout/> can be replaced with <merge/>
529
-
samples/too_deep.xml
530
-
-1:-1 This layout has too many nested layouts: 13 levels, it should have <= 10!
531
-
20:81 This LinearLayout layout or its LinearLayout parent is useless
532
-
24:79 This LinearLayout layout or its LinearLayout parent is useless
533
-
28:77 This LinearLayout layout or its LinearLayout parent is useless
534
-
32:75 This LinearLayout layout or its LinearLayout parent is useless
535
-
36:73 This LinearLayout layout or its LinearLayout parent is useless
536
-
40:71 This LinearLayout layout or its LinearLayout parent is useless
537
-
44:69 This LinearLayout layout or its LinearLayout parent is useless
538
-
48:67 This LinearLayout layout or its LinearLayout parent is useless
539
-
52:65 This LinearLayout layout or its LinearLayout parent is useless
540
-
56:63 This LinearLayout layout or its LinearLayout parent is useless
541
-
samples/too_many.xml
542
-
7:413 The root-level <FrameLayout/> can be replaced with <merge/>
543
-
-1:-1 This layout has too many views: 81 views, it should have <= 80!
544
-
samples/useless.xml
545
-
7:19 The root-level <FrameLayout/> can be replaced with <merge/>
546
-
11:17 This LinearLayout layout or its FrameLayout parent is useless
547
-
</pre>
494
+
<h2 id="lint">Using lint to Optimize Your UI</h2>
495
+
<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>
496
+
<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>
497
+
<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>
0 commit comments