Pages

Monday, 25 June 2012

To get the android device dimentions


public class DeviceDimentions {

Context context;
Display display;

public DeviceDimentions(Context context) {
this.context = context;
display = ((Activity) context).getWindowManager().getDefaultDisplay();
}

public int getWidth() {
return display.getWidth();
}

public int getHeight() {
return display.getHeight();
}
}

No comments:

Post a Comment