if i use the code shown here to get the total screen size it is always short on height to the total screen size as shown in the documented specs for the device. for example
If you're calling this outside of an Activity, you'll need to pass the context in (or get it through some other call). Then use that to get your display metrics:
DisplayMetrics metrics = context.getResources().getDisplayMetrics();
int width = metrics.widthPixels;
int height = metrics.heightPixels;