How to set resolution for smartphone web app

Hi!
I’m developing a web app for smartphone/tablet,is there any way to set an auto adapter resolution?

[quote=166046:@Diego Campanella]Hi!
I’m developing a web app for smartphone/tablet,is there any way to set an auto adapter resolution?[/quote]

What do you mean ?

I mean how to set the app resolution(width and height) compatible to all smartphones and tablet

You get the size of the client browser with WebPage.Width and WebPage.Height.

Then you must adjust the position of your controls according to that. Sometimes, it is easiest to create several webpages you show depending on the actual resolution, or a range of resolutions.

Here is a page where all sorts of screen sizes are considered. If you want to support most of the smart phones, it can be a precious study.

Plus, you may want to consider the fact that some users will rotate their devices.

You can change the scale by changing the header in the PrepareSession event

    HTMLHeader = HTMLHeader + "<meta name=""viewport"" content=""maximum-scale=0.5, minimum-scale=0.5"" />"

This would set it to 1/2 size.

[quote=166129:@Brock Nash]You can change the scale by changing the header in the PrepareSession event

    HTMLHeader = HTMLHeader + "<meta name=""viewport"" content=""maximum-scale=0.5, minimum-scale=0.5"" />"

This would set it to 1/2 size.[/quote]

That is a very neat tip. But since it takes place before the page is displayed, it is not possible to know the device screen size to adapt the scale to it.

And if I want to make it scrollable on smartphone/tablet’s browsers?

Just set the page height more than the screen resolution.

I did it but not work

Set the minimum height as well, otherwise it does not scroll. Default is 400. If you set min height to 4000 and the same for Height, it scrolls very nicely.