I'm trying to make a routine that gets the width and height of a device in
inches:
Here's what I came up with:
public void get_display_size() {
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
float width_in = metrics.widthPixels / metrics.xdpi;
float height_in = metrics.heightPixels / metrics.ydpi;
}
Does this look good?
Or is there a better way?
--
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