From 0980e41e97db0c7e57d114a1aae76663d637ba87 Mon Sep 17 00:00:00 2001
From: Rich Hyndman
In this lesson you'll learn to use Heirachy Viewer and Hierarchy Viewer and Layoutopt to examine and optimize your layout.
@@ -53,7 +53,7 @@ layout.The Android SDK tools include a tool called Heirachy Viewer that allows +href="{@docRoot}guide/developing/tools/hierarchy-viewer.html">Hierarchy Viewer that allows you to analyze your layout while your application is running. Using this tool helps you discover bottlenecks in the layout performance.
@@ -130,27 +130,28 @@ example of how each layout has appropriate uses and you should carefully conside layout weight is necessary. -It is always good practice to run the Lint tool on your layout files to search for possible view hierarchy optimizations. Lint has replaced the Layoutopt tool and has much greater functionality. Some examples of Lint rules are:
+ +Another benefit of Lint is that it is integrated into the Android Development Tools for Eclipse (ADT 16+). Lint automatically runs whenever you export an APK, edit and save an XML file or use the Layout Editor. To manually force Lint to run press the Lint button in the Eclipse toolbar.
+ +When used inside Eclipse, Lint has the ability to automatically fix some issues, provide suggestions for others and jump directly to the offending code for review. If you don’t use Eclipse for your development, Lint can also be run from the command line. More information about Lint is available at tools.android.com.
+ + -It is always good practice to also run the layoutopt tool on your final layout files -to search for places in your view hierarchy that may be optimized. Layoutopt is also in your SDK -{@code tools/} directory and takes a layout directory name or a space-separated list of layout files -that you'd like to inspect.
-When you run {@code layoutopt} on a layout file, it prints a line number for each issue found, a -description of the issue, and for some types of issues it also suggests a resolution. For -example:
--$ layoutopt samples/ -samples/compound.xml - 7:23 The root-level <FrameLayout/> can be replaced with <merge/> - 11:21 This LinearLayout layout or its FrameLayout parent is useless -samples/simple.xml - 7:7 The root-level <FrameLayout/> can be replaced with <merge/> --
After you apply the suggested layout optimizations, run Hierarchy Viewer again to inspect the -performance changes.
-- cgit v1.1