So i have a small problem, i\'m writing a function which need to send screen width to server. I got it all to work, and i use:
Display display = getWindowMan
You can check for API level at runtime, and choose which to use, e.g.:
final int version = android.os.Build.VERSION.SDK_INT;
final int width;
if (version >= 13)
{
Point size = new Point();
display.getSize(size);
width = size.x;
}
else
{
Display display = getWindowManager().getDefaultDisplay();
width = display.getWidth();
}