PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → WDM - Detecting Screen Size Of Device On Load
WDM - Detecting Screen Size Of Device On Load
Débuté par André Labuschagné, 26 nov. 2015 12:39 - 5 réponses
Posté le 26 novembre 2015 - 12:39
Hi All

Subject says it all. How does one detect the screen size of the device during the loading of an app - when the user tries to run it?

Cheers
André
Posté le 26 novembre 2015 - 12:52
did you try with SysScreenRectangle?
Posté le 26 novembre 2015 - 13:21
The help says WM will load the required layout for you, but it's not working for some reason in my situation.

I use SysXRes() together with WinChangeLayout() in de opening section of a window
Posté le 27 novembre 2015 - 08:17
Thanks for that Paulo and Arie. I have not tried any of those.

Basically we have designed the Android smartphone against the Samsung S6 and want to warn the user about screen size and not allow the app to run if the screen is too small.

Cheers
Andre
Posté le 27 novembre 2015 - 10:22
Andre,

the option in WM to use different "window layouts" works quite good.
You can redesign your window for a smaller screensize. I.e. make controls smaller, change positions or even make them invisible in a certain layout.
All code remains the same. And even if you don't want that, you can check the current screensize and run different code if necessary.

It is my humble opinion that all this is usefull only if you don't want to change the workflow of your application. An app designed for a S6 would also run on a S5 with the same user experience I believe,
But you should not use the same workflow on let's say a 10 inch tablet. Because the screen differs so much, I think you can put more controls/logic on one screen. And make life easier for the user do the job with a minimum of scrolling and going back/foreward from one window to the other.,
Posté le 28 novembre 2015 - 22:23
Hi Arie

The problem is that the windows will not scroll if there are scrollable controls on the window. So I have experimentally gone with a screen ratio of X to Y as the base test. If it is not meet the minimum requirement then the user gets a message that the app is not compatible with the device.

Cheers
André