Code example for Display

Methods: getSizegetWidth

0
		final Point size = new Point();
 
		try { 
			// If the device is API level 13 and above 
			// Use new API method 
			display.getSize(size);
			width = size.x;
			height = size.y;
 
		} catch (java.lang.NoSuchMethodError ignore) {
			// Older device below API level 13 use this 
			width = display.getWidth();
			height = display.getHeight();
		} 
 
		// Get smaller dimension 
		int smallerDimension = width < height ? width : height;
		return smallerDimension = smallerDimension * 7 / 8;
 
	} 
Connect your IDE to all the code out there  Get Codota for Java
4
CodeRank