private DisplayMetrics displayMetrics = new DisplayMetrics();
WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
windowManager.getDefaultDisplay().getMetrics(displayMetrics);
int height = displayMetrics.heightPixels;
int width = displayMetrics.widthPixels;
I've tried this from the service and it works for me. On 2.3 devices (tried on Galaxy Y and Nexus One) it gives the complete screen size. But on 4.x devices (tried on Nexus 4), It gives the screen size minus the status bar. If you have found a more reliable method do post.