4 Replies Latest reply on Jun 20, 2017 12:02 AM by jvagla

    WebDirect: Phone or Tablet?



      How i can detect a Phone or a Tablet?

      The old   get(ScreenDepth)  help not by WebDirect with the new displays.

      Regards, Arthur



      Samsung Galaxy S8+ 2960 X 1440 Android

      Samsung Galaxy S8 2960 X 1440 Android 7

      Apple iPhone7 1334 X 750

      Apple iPhone7 plus 1920 X 1080

      Apple iPhone 6s 1334 X 750

      Sony Xperia XZ premium 3840 X 2160



      Samsung Galaxy Tab S3 2048 X 1536

      Samsung Galaxy Tab S2 2048 X 1536

      iPad pro 9,7 2048 X 1536

        • 1. Re: WebDirect: Phone or Tablet?

          You could look how it's done in one of the starter solutions. They are using Get(Device) on choosing a layout by device. On "Get(Device) = 5" (5 is android), additional If statement for guessing if it's tablet or phone If[Get ( WindowWidth ) + Get ( WindowHeight ) > 1042] => tablet, otherwise phone. Get(Device) tells if it's iPad or iPhone.

          • 2. Re: WebDirect: Phone or Tablet?

            the new  Phone from Sony Xperia XZ premium  have 3840 X 2160,

            you have no control about  dpi or display-size with all FM-get-funcions.


            • 3. Re: WebDirect: Phone or Tablet?

              You are using Web Direct, so probably not so helpful:

              There are methods to get the user agent (and other Environmental Variables) from the browsers/user in web servers. It's part of what Google tracks, for example.

              You likely need a method to have the user go to a web page that can grab that data and pass along to the link to Web Direct. Then and only then can your "opening script" (I assume) would be able to "branch" based on the detection.

              JavaScript may help. Search for "browser environmental variables".

              Other answers also helpful!


              • 4. Re: WebDirect: Phone or Tablet?

                Mobile browsers don't use absolute resolution of the screen. They have so called css-width which is used for showing content. Images etc will show more detailed pixels like Retina screens in macs. https://mydevice.io/devices/

                1 of 1 people found this helpful