Android Layout for the Scenario
<p>I got a scenario where I need your help to point me out what layout or the combination of layout available in android can accomplish this.</p>

<p>I have <strong>n</strong> number of buttons to be added to the screen in some layout. The layout would be of <strong>wrap_content</strong> height and <strong>fill_parent</strong> width. I am going to add buttons to it dynamically of unknown sizes. The sizes of the button are unknown because the size of text inside it is unknown. </p>

<p>So assume</p>

<pre><code>String[] data = new String[5] { "This is small", "This is small", "This is big", "This is very big", "This button requires single line plus ellipses because this is extra big" };
for (int d = 0; d &lt; 5; d++) {
   Button btnNew = createNewButton(data[d]); // this function create a button object
   theLayout.addView(btnNew);
}
</code></pre>

<p>The above code will add 5 buttons to the layout and layout should be able to show them floating from left to right and bottom. It should take care of the button sizes so if the button is very big that it will fit on per line and won't leave enough space for the other button on that line to the right, the other button should start drawing from the new line instead from the right of the button drawn. In simple words, draw buttons from left to right but if the button sizes are crossing the parent element, wrap them to the new line.</p>

<p>I got a thought if I can use nested LinearLayout making 1st LinearLayout of orientation to vertical and 2nd to horizontal?  </p>
