I am currently using this code from this answer
var ratio = window.devicePixelRatio || 1;
var w = screen.width * ratio;
var h = screen.height * ratio;
It works on desktop firefox, but not on my android browsers (stock or chrome on my Samsung Galaxy S5 phone updated to android 5). I get 320x640 instead of 1280x1920.
Is there a reliable solution to detect screen sizes accross all devices & browsers? I need screen width of device, not inner/client widths or something else.
If it's not possible, several comments saying this is not possible from influential SO members would work fine - I could show this as proof to my client.