Programmatically set screen density on Android
<p>I'm writing a game which I want to run on medium and high densities (320x480 and 480x800). In order to run the app on both densities, I had to set support-screens param like this.-</p>

<pre><code>    &lt;supports-screens android:anyDensity="true" /&gt;
</code></pre>

<p>My problem is, in some 2nd generation devices (i.e. HTC Desire), the game runs on hd density, but the performance is a little poor, so I'm trying to 'force' medium density for those devices.</p>

<p>I've managed to get the current density like this.-</p>

<pre><code>    DisplayMetrics dm = new DisplayMetrics(); 
    getWindowManager().getDefaultDisplay().getMetrics(dm);
</code></pre>

<p>and DisplayMetrics class seems to have a 'setTo' method, but not sure if it fits my need, nor how exactly should I use it. Is there any way to achieve this?</p>

<p>Thanks!</p>
