how to make UI which support all devices without using xml in android?
<p>I am making UI in android using java code because all UI information comming from server so we can't use xml but there is problem when I create 7 button on screen by giving information it is supporting ldpi but rest of devices it is not working code is as-</p>

<pre><code>for (int index = 0; index &lt;7; index++) {


        Button objwidgetbutton = new Button(this);


        LinearLayout.LayoutParams objlayoutbtnparams = new LinearLayout.LayoutParams(280,LinearLayout.LayoutParams.WRAP_CONTENT); // Verbose!

        objwidgetbutton.setText("hiii");

        objwidgetbutton.setBackgroundResource(R.drawable.ic_launcher);

        llinner.addView(objwidgetbutton,objlayoutbtnparams);

    }
    objlinear.addView(llinner);
</code></pre>

<p>I am using this structure is as</p>

<pre><code>&lt;LinearLayout&gt;
  &lt;LinearLayout&gt;
   &lt;button/&gt;#7
  &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
</code></pre>

<p>Please guide me Is I going right path or doing other things?Main things is that how to make screen support all resolution</p>
