Check out example codes for "how to get the screen dimensions in java". It will help you in understanding the concepts better.

Code Example 1

Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();

Learn ReactJs, React Native from akashmittal.com