size of the usable screen
<p>I am using a Nexus 7 1280x800 android 4.2.2  API 17</p>

<p>I want to get the size of the screen to divide it in square sections of the same height and width.</p>

<p>I am using FrameLayout and my squares are subclass of ImageView.</p>

<p>I do this</p>

<p><code>
context.getResources().getDisplayMetrics().heightPixels;   ----&gt; 1205
 context.getResources().getDisplayMetrics().widthPixels;   ------&gt; 800
</code></p>

<p>I suppose 1205 is not 1280 because there are two Android menus on top and bottom of the screen.</p>

<p>Each of my squares is 30x30 px.</p>

<p>To know how many squares I can draw as maximun I do:</p>

<p><code>
 int x=1205/30;
</code></p>

<p>When I try to paint my image on coords <code>(x-1)*30 ,y</code> it is drawn partially out of the screen.</p>

<p>How can I know the portion of screen my application can use?</p>

<p>I hope I explained well my issue.</p>

<p>Many thanks.</p>
