I have tried different ways to get the screen size of the device, but it always returned me the wrong size (791x480 instead of 854x480). It might be du
791x480
854x480
Try calling
display.getRealSize();
DISCLAIMER: I did not realize this, but this will only work for API 17 (Android 4.2/JellyBean) and up.