Mobile Development 10.11 | webMethods Mobile SuiteWeb Help | webMethods Mobile Designer Native User Interface Reference | Mobile Designer Native User Interface | Using Multiple Panes for Tablet User Interfaces | Determining the Device Size at Run Time
 
Determining the Device Size at Run Time
If a target platform supports multiple panes, one way to determine whether to use the multiple-pane logic rather than use a single-screen logic is by determining the size of the device on which the application is running. After determining the size of the device, the application can then execute the appropriate logic for the device size.
At run time, the physical screen size of the device is not available because this value is not stored anywhere. However, the application can determine the screen size by checking the screen resolution against the screen’s pixels per inch (PPI). The screen resolution and PPI values are stored in the device profile. At run time, the application can query the values using the nUIController.getScreenWidth(), nUIController.getScreenHeight() and nUIController.getScreenPPI() methods.
You code the application to determine what size is considered a tablet. For example, the logic might consider that any device with a screen size that exceeds six inches diagonally is a tablet.
To see sample code that performs this logic, review the code in the Mobile Designer NativeUIDemoNew sample.