I'm thinking about the usage of percent, example, in margins.

We can use overlay to separate our layout by DPI sizes, but why can't we use percentage?

Something like that:

Display display = getWindowManager().getDefaultDisplay();

float width = display.getWidth();
float height = display.getHeight();

//20% of left margin
float imageMarginLeft = ( width * 20 ) / 100;


And then set this margin to the image, or whatever element.