Home > Google Android > Debug your app layouts -> hierarchy

Debug your app layouts -> hierarchy

This post is focused on one from Android’s tools -> hierarchyviewer “./tools/hierarchyviewer” .  In this post is touched only part of Views display  -> which is really powerful to get information about background of displayed content . Hierarchyviewer contains also Pixel Perfect View providers to check your graphical quality.

Views hierarchy is downloaded directly from your devices or emulator. That means it doesn’t depend on way of your Layout definition.  In my example layout is defined in the source code in the following manner. See the code snipped


LinearLayout row1 = new LinearLayout(this);
LinearLayout row2 = new LinearLayout(this);

LinearLayout row3 = new LinearLayout(this);
row3.addView(fahrenheitField, new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
LinearLayout row4 = new LinearLayout(this);
mainLayout = new LinearLayout(this);

// setting the view to the “master” layout


As is usual you need to sent the root View to the chain by setContentView method from the app framework.  Commonly you are calling it in this way setContentView(R.layout.main);  which means your content is stored in XML file.In this simple example should be  practically explained figure from Android documentation about User interface definition

Categories: Google Android
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: