AndroidUI optimization tool-HierarchyViewer

Source: Internet
Author: User

Let me talk about some other things. I hope you will be able to become a candidate for the 2013 blog star. I look forward to your vote. Thank you.

 

Vote:

Http://vote.blog.csdn.net/blogstaritem/blogstar2013/xyz_lmn

 

Next to the question, we will refer to how to use HierarchyViewer and HierarchyViewer.

 

Why do I use HierarchyViewer?

Unreasonable layout slows down the UI performance of our application. HierarchyViewer can visually obtain information about the UI layout design structure and various attributes, helping us optimize the layout design. HierarchyViewer is one of our optimization program tools. It is a very useful tool that comes with Android. It can help us better view and design the user interface (UI). It is definitely a powerful tool for UI inspection.

 

How to Use HierarchyViewer

Hierarchy Viewer is a tool released with Android SDK, which is located in Android SDK/tools/hierarchyviewer. bat (in Windows, hierarchyviewer is displayed on mac), which is also super simple to use, this tool provides a detailed understanding of the control layout on the current interface and the attributes (such as name, id, and height) of a control ).

1) connect to the real machine or simulator of the device (the real machine may not be connected. I used 2.3, but it was connected and did not read the content );

2) start the application you want to observe.

3) Open Hierarchyviewer and click the hierarchyviewer file. After the connection, for example, this figure is obtained in the official document.

 

 

4) double-click the top Window, as shown in <Focused Window>. This is the current Window. After loading, the hierarchy of the current interface is displayed.

 

 

5) observe the hierarchy chart. This chart is a bit large and can be dragged. The View Hierarchy window displays all View objects of the Activity. You can select a View and View Details. It is best to select the Show Extras option in the tool.

 

 

6) observe a single view. After selecting a single view, the image shown in is displayed. Here we can see the time consumed by Measure, Layout, and Draw.

 

 

View Hierarcy also helps you identify lower rendering performance. A red or yellow vertex in a View node represents a slow View object. For example, if you run an application in a single step, you can determine whether a View is slow or slow only in a specific environment.

Please note that low performance does not mean there is a problem, especially for ViewGroup objects. The more child nodes of the View, the more complex the structure, and the worse the performance.

The View Hierarchy window also helps you find performance problems. You only need to check the performance indicators (color points) of each View node. You can see which is the slowest View object for measurement (layout or drawing), so that you can quickly determine, which problem should be checked first.

 

 

/*** @ Author Zhang xingye * http://blog.csdn.net/xyz_lmn* iOS entry group: 83702688 * android development advanced group: 241395671 * my Sina Weibo: @ Zhang xingye TBOW*/

 

 

Refer:

Http://developer.android.com/tools/help/hierarchy-viewer.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.