PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → [WB19] Is anyone catering for mobile devices in WB?
[WB19] Is anyone catering for mobile devices in WB?
Débuté par DarrenF, 20 nov. 2014 18:34 - 7 réponses
Posté le 20 novembre 2014 - 18:34
Hi,

What I mean is, when someone on a mobile device visits your URL, is anyone checking that a mobile device is trying to use your site?

If so, is there a standard bit of code to detect a mobile device and what are people doing to cater for it? Writing a completely different site for mobile or catering for it with anchors (if that's even possible) :confused:
Posté le 20 novembre 2014 - 20:16
Hi Darren,

I think BrowserPlatform() will help you do exactly what you want: <a class="ExternalLink" rel="nofollow" target="_blank" href="http://doc.windev.com/en-US/?1000019486">http://doc.windev.com/en-US/&hellip;</a>

Best regards,
Alexandre Leclerc
Posté le 20 novembre 2014 - 20:48
Ah, thanks Alexandre.

Is that what people are really doing... developing what is essentially 2 sites?
Posté le 20 novembre 2014 - 20:57
Hi Darren,

Up to V19 this is the official way to do it from PCSoft's point of view. One of their argument is that the website pages will be faster and react faster (instead of using a lot of JavaScript to always check page size and move the fields around, etc. I think they have a point on that side.)

But with the anchors it's easier to make not to many web pages. One normal and one for smaller formats with anchors. It was a good feature they added.

Best regards,
Alexandre Leclerc
Posté le 20 novembre 2014 - 22:31
Hi

on top of Alexandre answer, a few -disturbing- thoughts:
- a mobile (as detected by the aforementioned function) can be a 240*320 screen, but it can also be a 3000x2000 one
- a mobile (as detected by the aforementioned function) can be a 2.5 inch screen, but it can also be a 12 inches tablet
- there is no definite relationship between the pixel resolution and the size of the screen (as some 5/6 inches phones have a higher resolution than many 10 inches tablets).

Because of these realities, relying on the fact that the browser is a "mobile" browser to display one page or another is a recipe for disaster. The only I have found that give some semi-reliable result is to load a first page and use JS code to detect the screen size in pixels...

With a mobile browser AND below a specific value, I am SURE that I need to display a simplified version of the site and redirect to (m.mysite.com). Above that value, and with a mobile browser, we may be on a middle resolution tablet good enough for the regular site or on a high resolution phone where you would need a microscope...

So asking the user if he want to be redirected to the mobile site is generally the solution. Also, providing an easy to find link to switch between mobile and desktop sites is a must...

And finally, yes, using two sets of pages is generally necessary, and not only for screen size problem... Using a website with fingers instead of a mouse generally requires some changes to the UI, and the bandwith available to mobile users may not be as good as one could hope.


Best regards
Posté le 20 novembre 2014 - 22:32
Hmmm... looking more closely at the function, that function is only for server code - what if it's a static site like mine with no option to enter Server code? :confused:
Posté le 21 novembre 2014 - 01:36
Hi Fabrice,

A very interesting and insightful discussion and some of your ideas I was coming around to. My non-descript 4.7" (12cm) screened smartphone has a resolution of 1280 x 720 which not too long ago was the resolution of a relatively large monitor used with a desktop? ...so I see what you are saying.

It looks like (with a static WB site) my friends here might be the SysXRes & SysYRes functions as they are WB browser side only :spos: ...and by using screen res as an initial default and your idea of then allowing the user to choose might just be a way forward.

:cheers:
Posté le 22 novembre 2014 - 10:54
Hi,
I have been testing a WB19 web site that supports mobile and desktop browsers.
What I found - from a users perspective - is that the screen resolution does not play THE most significant role.
? resolution of say 1024*768 on a mobile is NOT the same as a resolution of 1024*768 on an 19" monitor. The only thing that is the same is the number of pixels ....
Fonts are smaller, accessing things on the mobile is far more difficult with your fingers and so on ...
I think the first priority is to distinguish between MOBILE browsers and "Desktop" browsers.
After that you can - if you like - distinguish between LOW resolution MOBILEs and HIGH resolution mobiles.
Just looking at resolution is a VERY BAD IDEA

Steven Sitas