available screen width in web-app

I have a web-app that I would like to be useful on DT and phone. In order to get the proper layout parts I tried to use


as I found somewhere in an example.
This wont’t work and reports error that type doesn’t exist.

Is there another way to find out the size of the screen that the app is running one?

running on

Hi Dick,

Web app doesn’t know anything about physical screen.
Web app layout is based on browser and webpage.
You need to check the browser page size in webpage.shown event and listen to resized event.

That’s not entirely accurate. There is a JavaScript property available on all modern browsers which will give you this information.


It’s a structure containing multiple items including screen dimensions, browser dimensions and browser offset from the top/left corner of the screen. You’ll need a WebSDK control to retrieve it though.

You’re right, but getting these properties require javascript (even within WebSDK), AFAIK.
Getting the physical screen size is not going to help in this case, as the layout has to fit the browser.