Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf15ce6d authored by Dirk Dougherty's avatar Dirk Dougherty
Browse files

doc change: add SDK sizes, checksums, small changes for online SDK doc set, add layoutopt doc.

Bug:2160782
Change-Id: I020b31e10f2733223aa37d03687cf8a63843afa7
parent a250f0c8
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -30,6 +30,11 @@ applications on the emulator. </p>
    <dd>The Hierarchy Viewer tool allows you to debug and optimize your user interface.
    <dd>The Hierarchy Viewer tool allows you to debug and optimize your user interface.
        It provides a visual representation of your layout's hierarchy of Views and a magnified inspector
        It provides a visual representation of your layout's hierarchy of Views and a magnified inspector
        of the current display with a pixel grid, so you can get your layout just right.
        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>
    </dd>


	  <dt><a href="draw9patch.html">Draw 9-patch</a></dt>
	  <dt><a href="draw9patch.html">Draw 9-patch</a></dt>
+62 −0
Original line number Original line Diff line number Diff line
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>
+1 −0
Original line number Original line Diff line number Diff line
@@ -255,6 +255,7 @@
      		<li><a href="<?cs var:toroot ?>guide/developing/tools/draw9patch.html">Draw 9-Patch</a></li>
      		<li><a href="<?cs var:toroot ?>guide/developing/tools/draw9patch.html">Draw 9-Patch</a></li>
      		<li><a href="<?cs var:toroot ?>guide/developing/tools/emulator.html">Emulator</a></li>
      		<li><a href="<?cs var:toroot ?>guide/developing/tools/emulator.html">Emulator</a></li>
      		<li><a href="<?cs var:toroot ?>guide/developing/tools/hierarchy-viewer.html">Hierarchy Viewer</a></li>
      		<li><a href="<?cs var:toroot ?>guide/developing/tools/hierarchy-viewer.html">Hierarchy Viewer</a></li>
      		<li><a href="<?cs var:toroot ?>guide/developing/tools/layoutopt.html">layoutopt</a></li>
      		<li><a href="<?cs var:toroot ?>guide/developing/tools/othertools.html#mksdcard">mksdcard</a></li>
      		<li><a href="<?cs var:toroot ?>guide/developing/tools/othertools.html#mksdcard">mksdcard</a></li>
      		<li><a href="<?cs var:toroot ?>guide/developing/tools/monkey.html">Monkey</a></li>
      		<li><a href="<?cs var:toroot ?>guide/developing/tools/monkey.html">Monkey</a></li>
      		<li><a href="<?cs var:toroot ?>guide/developing/tools/adb.html#sqlite">sqlite3</a></li>
      		<li><a href="<?cs var:toroot ?>guide/developing/tools/adb.html#sqlite">sqlite3</a></li>
+9 −5
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@ parent.link=index.html
    <li><a href="#SizePaddingMargin">Size, Padding and Margins</a></li>
    <li><a href="#SizePaddingMargin">Size, Padding and Margins</a></li>
    <li><a href="#example">Example Layout</a></li>
    <li><a href="#example">Example Layout</a></li>
  </ol>
  </ol>

</div>
</div>
</div>
</div>


@@ -41,14 +42,17 @@ application can create View and ViewGroup objects (and manipulate their properti
<p>The Android framework gives you the flexibility to use either or both of these methods for declaring and managing your application's UI. For example, you could declare your application's default layouts in XML, including the screen elements that will appear in them and their properties. You could then add code in your application that would modify the state of the screen objects, including those declared in XML, at run time. </p>
<p>The Android framework gives you the flexibility to use either or both of these methods for declaring and managing your application's UI. For example, you could declare your application's default layouts in XML, including the screen elements that will appear in them and their properties. You could then add code in your application that would modify the state of the screen objects, including those declared in XML, at run time. </p>


<div class="sidebox">
<div class="sidebox">
  <p>The <a href="{@docRoot}guide/developing/tools/adt.html">Android Development Tools</a> 
  <ul>
  (ADT) plugin for Eclipse offers a layout preview of your XML &mdash; 
  <li>The <a href="{@docRoot}sdk/eclipse-adt.html">ADT
  with the XML file opened, select the <strong>Layout</strong> tab.</p>
  Plugin for Eclipse</a> offers a layout preview of your XML &mdash; 
  <p>You should also try the 
  with the XML file opened, select the <strong>Layout</strong> tab.</li>
  <li>You should also try the 
  <a href="{@docRoot}guide/developing/tools/hierarchy-viewer.html">Hierarchy Viewer</a> tool, 
  <a href="{@docRoot}guide/developing/tools/hierarchy-viewer.html">Hierarchy Viewer</a> tool, 
  for debugging layouts &mdash; it reveals layout property values, 
  for debugging layouts &mdash; it reveals layout property values, 
  draws wireframes with padding/margin indicators, and full rendered views while 
  draws wireframes with padding/margin indicators, and full rendered views while 
  you debug on the emulator or device.</p>
  you debug on the emulator or device.</li>
  <li>The <a href="{@docRoot}guide/developing/tools/layoutopt.html">layoutopt</a> tool lets
  you quickly analyze your layouts and hierarchies for inefficiencies or other problems.</li>
</div>
</div>


<p>The advantage to declaring your UI in XML is that it enables you to better separate the presentation of your application from the code that controls its behavior. Your UI descriptions are external to your application code, which means that you can modify or adapt it without having to modify your source code and recompile. For example, you can create XML layouts for different screen orientations, different device screen sizes, and different languages. Additionally, declaring the layout in XML makes it easier to visualize the structure of your UI, so it's easier to debug problems. As such, this document focuses on teaching you how to declare your layout in XML. If you're
<p>The advantage to declaring your UI in XML is that it enables you to better separate the presentation of your application from the code that controls its behavior. Your UI descriptions are external to your application code, which means that you can modify or adapt it without having to modify your source code and recompile. For example, you can create XML layouts for different screen orientations, different device screen sizes, and different languages. Additionally, declaring the layout in XML makes it easier to visualize the structure of your UI, so it's easier to debug problems. As such, this document focuses on teaching you how to declare your layout in XML. If you're
+4 −2
Original line number Original line Diff line number Diff line
@@ -539,8 +539,10 @@ height="158" style="margin-left:15px"></p>
<p><img src="{@docRoot}images/hello_l10n/using_custom_locale.png" alt="using custom locale"
<p><img src="{@docRoot}images/hello_l10n/using_custom_locale.png" alt="using custom locale"
width="512" height="299" style="margin-left:15px"></p>
width="512" height="299" style="margin-left:15px"></p>


<p>For a list of supported locales in a specific Android platform, see the 
<p>For a list of locales available on different versions of the Android platform,
associated notes in the "SDK" tab, under "Downloadable SDK Components."</p>
refer to the platform notes documents, listed under "Downloadable SDK Components"
in the "SDK" tab. For example, <a 
href="{@docRoot}sdk/android-2.0.html#locs">Android 2.0 locales</a>.</p>


<p>Run the application for each of the expected locales, plus one unexpected
<p>Run the application for each of the expected locales, plus one unexpected
locale. Here are some of the results you should see:</p>
locale. Here are some of the results you should see:</p>
Loading