Layout Tools

To assist you in creating the best layouts, the Android SDK provides two easy-to-use tools: hierarchyviewer and layoutopt. You can find these tools, among others, in the SDK tools directory.

Hierarchy Viewer

The Android SDK comes with a very useful tool to view and analyze your application's layout: hierarchyviewer. As a matter of fact, Figure 8–1 and Figure 8–2 were generated using that tool. In addition to showing you the detailed layout of your application, this tool also measures how much time it takes to measure, lay out, and draw each widget, and identifies which widgets took longer to measure, lay out, and draw.

You can use hierarchyviewer as a standalone tool or directly in Eclipse with the “Hierarchy View” perspective.

Get Pro Android Apps Performance Optimization now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.