Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #33892

Re: detect a phone

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: detect a phone
Date 2017-08-27 04:00 +0200
Organization PointedEars Software (PES)
Message-ID <4031972.LvFx2qVVIh@PointedEars.de> (permalink)
References <WoqdnVwVzJe7ozzEnZ2dnUU7-YvNnZ2d@westnet.com.au> <1476139f4sckg$.1gbfz2yz2pha8$.dlg@40tude.net> <eLWdnaoq9vnQaTzEnZ2dnUU7-X3NnZ2d@westnet.com.au>

Show all headers | View raw


Andrew Poulos wrote:

> On 27/08/2017 3:03 AM, JJ wrote:
>> IMO, the presence check of `window.ontouchstart` alone is reliable enough
>> to detect whether the device is a mobile device or not.

Depends.  You can enable support for touch events in Chrome, for mobile 
testing, *without* the corresponding display size.

>> My phone has a 1080x1920 screen, so it has more than 600px on any of its
>> screen side.
> 
> The pixel size of an iPhone 7 plus is 1080 x 1920 but the viewport size
> is only 441 x 736.
> 
> The pixel size of a Google Pixel is 1080 x 1920 but the viewport size is
> 411 x 731.
> 
> The pixel size of a Samsung Galaxy Note 5 is 1440 x 2560 but the
> viewport size is 480 x 853.

Note that the Note 5 and the failed Note 7 have been succeeded by the Note 8 
with QHD+ display as of 2017-08-23.

For the Galaxy S7 and S7 Edge at least, the display resolution is now 
*variable* (a feature of Samsung TouchWiz 6.0, previously only by third-
party app): Display resolution is reduced *by default* (on the S7, from WQHD 
to FHD) in “Power saving mode”.  I understand that Samsung Game Launcher can 
also reduce the display resolution for games if that is desired.

Add to that the virtual desktops (split screen) introduced with Android 6.0 
“Marshmallow”.
 
> What phone do you have?

For real, Samsung Galaxy S7.  BrowserStack has others.

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

detect a phone Andrew Poulos <ap_prog@hotmail.com> - 2017-08-26 19:23 +1000
  Re: detect a phone "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-08-26 11:44 +0200
    Re: detect a phone Andrew Poulos <ap_prog@hotmail.com> - 2017-08-27 00:09 +1000
      Re: detect a phone "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-08-26 20:02 +0200
  Re: detect a phone Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2017-08-26 20:42 +0800
  Re: detect a phone "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-08-26 09:40 -0700
    Re: detect a phone Andrew Poulos <ap_prog@hotmail.com> - 2017-08-27 08:48 +1000
      Re: detect a phone "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-08-26 16:31 -0700
      Re: detect a phone Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-08-27 03:35 +0200
  Re: detect a phone JJ <jj4public@vfemail.net> - 2017-08-27 00:03 +0700
    Re: detect a phone Andrew Poulos <ap_prog@hotmail.com> - 2017-08-27 08:21 +1000
      Re: detect a phone Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-08-27 04:00 +0200
        Re: detect a phone Andrew Poulos <ap_prog@hotmail.com> - 2017-08-27 18:13 +1000
          Re: detect a phone Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-08-27 15:15 +0200
    Re: detect a phone Mark Lloyd <not@mail.invalid> - 2017-08-27 11:30 -0500
  Re: detect a phone Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-08-27 03:33 +0200

csiph-web