I don't think you will be able to do this with a XML layout. You probably want to take a look at this
http://developer.android.com/reference/android/util/DisplayMetrics.html#xdpi There is both xdpi and ydpi. That should be checked to get the actual dpi in both directions and then a view created with those calculations should get you where you want to go. Here is what I get on a few of my devices in portrait mode: // --- Sample Code Start --- DisplayMetrics metrics = new DisplayMetrics(); Display display = getWindowManager().getDefaultDisplay(); display.getMetrics( metrics ); Log.i( "TestProject", "X DPI: " + metrics.xdpi ); Log.i( "TestProject", "Y DPI: " + metrics.ydpi ); // --- Sample Code End --- *Samsung Galaxy Tab (7 inch):* X DPI: 168.89351 Y DPI: 169.33333 *Motorola Droid Bionic:* X DPI: 258.79245 Y DPI: 256.67368 *Sony Xperia Play:* X DPI: 239.05882 Y DPI: 243.72585 Steven Studio LFP http://www.studio-lfp.com -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en