I have seen Detecting whether Android device is a phone or a tablet with javascript but I want to know if there has been any newer, more stable way to do this as it seems the method described on the answer section is inconsistent.
Basically, I have a website that I have an Android app for but I only want to alert those who are on mobile devices as I want to show the full site to tablet users.
Another method would be to go by screen width/height. Tablets are larger than phones after all.
For example, if you know you’re dealing with either an android phone / tablet check the
screen.widthproperty.This method can be particularly useful if you’re interested in taking advantage of larger resolutions which some tablets may have. Not all tablets will have a larger screen after all.
I’d advise against using User Agents. They’re dependant on the browser which the user is currently using.