summaryrefslogtreecommitdiffstats
path: root/docs/html/guide/developing/tools
diff options
context:
space:
mode:
authorDirk Dougherty <ddougherty@google.com>2009-10-28 23:54:35 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2009-10-28 23:54:35 -0700
commitb7e7b710654b0a99fb8c41a7c47fe6b0f48f6db9 (patch)
treeb220997afa658f225834172920ad3b482cb4cb15 /docs/html/guide/developing/tools
parent4144f04b19fc2ebba9b5d232203a7641d8c8aec9 (diff)
parenta292fefeb77ed8e33afd7451090c3e21761fd266 (diff)
downloadframeworks_base-b7e7b710654b0a99fb8c41a7c47fe6b0f48f6db9.zip
frameworks_base-b7e7b710654b0a99fb8c41a7c47fe6b0f48f6db9.tar.gz
frameworks_base-b7e7b710654b0a99fb8c41a7c47fe6b0f48f6db9.tar.bz2
am a292fefe: am 4c071f0d: am 59625fa8: am 946f9d1e: Merge change I020b31e1 into eclair-sdk
Merge commit 'a292fefeb77ed8e33afd7451090c3e21761fd266' * commit 'a292fefeb77ed8e33afd7451090c3e21761fd266': doc change: add SDK sizes, checksums, small changes for online SDK doc set, add layoutopt doc.
Diffstat (limited to 'docs/html/guide/developing/tools')
-rw-r--r--docs/html/guide/developing/tools/index.jd5
-rw-r--r--docs/html/guide/developing/tools/layoutopt.jd62
2 files changed, 67 insertions, 0 deletions
diff --git a/docs/html/guide/developing/tools/index.jd b/docs/html/guide/developing/tools/index.jd
index 91b430f..6e9fde1 100644
--- a/docs/html/guide/developing/tools/index.jd
+++ b/docs/html/guide/developing/tools/index.jd
@@ -32,6 +32,11 @@ applications on the emulator. </p>
of the current display with a pixel grid, so you can get your layout just right.
</dd>
+ <dt><a href="layoutopt.html">layoutopt</a></dt>
+ <dd>This tool lets you quickly analyze your application's layouts for
+efficiency.
+ </dd>
+
<dt><a href="draw9patch.html">Draw 9-patch</a></dt>
<dd>The Draw 9-patch tool allows you to easily create a
{@link android.graphics.NinePatch} graphic using a WYSIWYG editor. It also previews stretched
diff --git a/docs/html/guide/developing/tools/layoutopt.jd b/docs/html/guide/developing/tools/layoutopt.jd
new file mode 100644
index 0000000..72a110d
--- /dev/null
+++ b/docs/html/guide/developing/tools/layoutopt.jd
@@ -0,0 +1,62 @@
+page.title=layoutopt
+@jd:body
+
+<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 directories to quickly check for inefficiencies or
+other types of problems that could be affecting the performance of your
+application. </p>
+
+<p>To run the tool, open a terminal and launch <code>layoutopt
+&lt;resources&gt;</code> from your SDK <code>tools/</code> directory. In the
+command, supply a list of uncompiled resource xml files or directories that you
+want to analyze. </p>
+
+<p>When run, the tool loads the specified XML files and analyzes their layout
+structures and hierarchies according to a set of predefined rules. If it detects
+issues, it outputs information about the issues, giving filename, line numbers,
+description of issue, and for some types of issues a suggested resolution. </p>
+
+<p>Here's an example of the output:</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>
+
+<p>The <code>layoutopt</code> tool is available in SDK Tools, Revision 3 or
+later. If you do not have SDK Tools 3 or later installed in your SDK, you can
+download it from the Android SDK repository site using the Android SDK and AVD
+Manager. For information, see <a
+href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a>.</p>
+
+<h3>Usage</h3>
+
+<p>To run <code>layoutopt</code> against a given list of layout resources:</p>
+
+<pre>layoutopt &lt;list of xml files or directories></pre>
+
+<p>For example:</p>
+
+<pre>$ layoutopt res/layout-land</pre>
+<pre>$ layoutopt res/layout/main.xml res/layout-land/main.xml</pre>