[Galaxy Note II Original Android Development] rovo89:
You can use different units to specify dimensions/sizes. Look at this page: http://developer.android.com/guide/topics/resources/more-resources.html#Dimension

And here is a method from the class TypedValue (used for resources):

public static float applyDimension(int unit, float value,
DisplayMetrics metrics)
{
switch (unit) {
case COMPLEX_UNIT_PX:
return value;
[B] case COMPLEX_UNIT_DIP:
return value * metrics.density;[/B]
case COMPLEX_UNIT_SP:
return value * metrics.scaledDensity;
case COMPLEX_UNIT_PT:
return value * metrics.xdpi * (1.0f/72);
case COMPLEX_UNIT_IN:
return value * metrics.xdpi;
case COMPLEX_UNIT_MM:
return value * metrics.xdpi * (1.0f/25.4f);
}
return 0;
}

I looked into the layout for the calculator in an S2 ICS ROM and it used dip as unit all over the place. For example, the width of the FrameLayout was hardcoded to 320dip. metrics.density is set to (DPI / 160). The default DPI for the S2 is 240, so it would be 320 * (240 / 160) = 480px. Oh wonder, the S2 has a 480x800px screen, so it will fit.

Now I change the DPI to 180. Boom, now we have only 360px, so there are 120px unused. If you know the device where you want to use the app, you can exchange one evil for another and hardcode everything to px. In this case, the sizes in px will obviously always be the same as DPI doesn't appear in the formula. Then take this to a device with a bigger screen and it will look messed up again. Of course, this isn't exactly a best practice: http://developer.android.com/guide/practices/screens_support.html#screen-independence

So what's better? There are some things for which it is fine to have a fixed size. Take the status bar height. It doesn't need to be higher for taller devices. So using a fixed height is fine for this. With dip, it will appear bigger for higher DPIs, which I think is absolutely correct. For me, the phone looks like a child's toy at 240 dpi, but if someone has bad eyes or has troubles hitting the correct buttons, the controls may be bigger.

Then look at the status bar width. It would look very strange if it ended after 80% of the screen width. The status bar has no fixed width. It should be exactly as wide as the screen really is. None of the dimension units can do this. Instead, Android offers something like "match_parent", layout_weight and so on, which give the element a certain percentage of the screen's (or parent element's) size. And for this, it doesn't matter how big the screen is or which density is used. 25% of the screen width is always just that.

The problem here is: I don't think it is possible to automate this. It depends on the target app. It should be possible to write a module which changes individual elements for a specific app one by one. I don't know the problems with the sidebar, but if for example takes up only 80% of the screen height, it should be possible to write a targeted module which changes this to "match_parent". Changing whole layouts might also be possible, but much more complicated. Might be easier to just determine the screen size, calculate a certain percentage of it and then set this as new "hardcoded" size. It really depends on the specific app. And therefore, I don't think App Settings is the right place for this.