game grid will not scale appropriately for different phones on android
<p>I'm creating a grid for my game, but I want the size of the grid to vary, depending on the phone's dimensions. When I run the code (note: I removed a lot from ondraw, only concerned about lines atm), it seems like the size of the grid is the same on both my HTC Desire and Wildfire - Which makes the grid look perfect on the wildfire, but there is a massive space below the grid on the desire- prob cos the desire screen is bigger? What I'm asking is...</p>

<p>How do i make the grid scale to the phones dimensions - I want the grid to take up the majority of the phone's screen, but have a margin.Thanks</p>

<pre><code>   protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);

        padding = 8;
        for (int i = 0; i &lt; 9; i++) {
            canvas.drawLine(padding + testWidth* i, padding, padding
                    + testWidth * i, testWidth* 8+padding, dark);
            canvas.drawLine(padding,  padding+testWidth* i, testWidth* 8
                    + padding, padding+testWidth* i, dark);
        }
    }

}
    public void onSizeChanged(int w, int h, int oldw, int oldh) {
        testWidth= w / 9f;
        testHeight = h / 9f;
        border = w;
        getRect(selX, selY, selRect);
        super.onSizeChanged(w, h, oldw, oldh);

    }
</code></pre>

<p>EDIT: I can now make a grid that scales to the phone's dimensions, however it is a rectangular grid. It looks kind of silly, I need a square one. Maybe I should make padding bigger if the screen is bigger?</p>
