Java : Get size and orientation of android device
// First, you need to get the Display from the WindowManager Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay(); // Now you can call all display-related methods
int width = display.getWidth(); int height = display.getHeight(); int orientation = display.getOrientation();
Comments
Post a Comment