I have a Generic Pool that i am making here:
public class FruitPool extends GenericPool {
// ======================================================
Here is the api I have written to get the screen width, you need a context to get the window system service. Similarly you can get the height.
int getWindowWidth() {
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
Point size = new Point();
display.getSize(size);
return size.x;
}