Hopefully, when they fix the Droid it won't report 240. That's what the emulator reports with a screen size of 3.7 (diagonal) and WVGA854. I tried 240 on my Droid, and it's definitely not as accurate as 264. At 240 pixels/inch, the Droid would have a 2 inch wide screen. The actual width is 1.8 inches.
On Aug 10, 12:41 am, Rob <[email protected]> wrote: > Thanks, Mark. That seems to work. I'm using this: > > float pixels_per_X_inch = displayMetrics.xdpi; > float pixels_per_Y_inch = displayMetrics.ydpi; > > if(Build.DEVICE.equals("sholes") && Build.MODEL.equals("Droid")) > { > pixels_per_X_inch = 264; // 480/(9*3.7/sqrt(337)) = 264.613474 > pixels_per_Y_inch = 264; // 854/(16*3.7/sqrt(337)) = > 264.820203 > } > > The 3.7 is the diagonal of the screen in inches (from the device > specification). It's supposed to be a 16:9 display with a resolution > of 480x854. If somebody knows for certain what the device should > return for the xdpi/ydpi, please, post it. I'm sure that 3.7 inches > is not exact, so maybe I'm off by a few pixels, but for sizing my > tiles to 1 cm it works quite well. > > On Aug 9, 4:48 pm, Mark Murphy <[email protected]> wrote: > > > On Mon, Aug 9, 2010 at 7:24 AM, Rob <[email protected]> wrote: > > > How do I detect what hardware my app is running on? I mean the > > > specific brand and model. > > > android.os.Build has that information. > > > -- > > Mark Murphy (a Commons > > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > > _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9 > > Available! > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

