How to detect tablet against smartphone in javascript [Phonegap application]

I know that it is possible to detect it using css queries, but I do not want to do this. I also do not want to use the scree.size solution because this is not true. I also tried userAgent, but I can not distinguish between an Android tablet and an Android smartphone. So how can I just check if it is a tablet (Android or iPad) or a smartphone (iPhone or Android).

can't find the right solution .. thanks

+4
source share
1 answer

like Marc Ster, said many years ago, for example:

var isPhone = screen.height < 800 || screen.width < 800; 
+2
source

Source: https://habr.com/ru/post/1483394/


All Articles