Possible Duplicate:
How to get screen size and respond to it?
Can I get the size of the screen android phone, similar to the same method in the computer. I'm interested in the screen resolution and (or) diagonal screen.
Is there a possibility to find me interesting information, it can be anologii transaction for Computer:
Toolkit toolkit = getDefaultToolkit();
Dimension screenSize = toolkit.getScreenSize();
int widthScreen = screenSize.width;
int heightScreen = screenSize.height;
http://developer.android.com/reference/android/util/DisplayMetrics.html
You can use it as follows:
DisplayMetrics displaymetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
int height = displaymetrics.heightPixels;
int width = displaymetrics.widthPixels;
for density, there's
int densitiy = displaymetrics.densityDpi;