title: Detecting screen density programmatically, pre-Honeycomb
body: <p>I have a layout that works in certain phones, but in the Samsung Galaxy Ace doesn't work properly. I need to create a new layout for this phone (and similar) but I can't do it programmatically with <a href="http://android-developers.blogspot.nl/2011/07/new-tools-for-managing-screen-sizes.html" rel="nofollow">this</a> or <a href="http://developer.android.com/guide/practices/screens_support.html" rel="nofollow">this</a> since this phone uses Android 2.2 and those solutions are for Android 3.2 and upwards. How can I create a new layout for this phone below Android 3.2?</p>