Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Husten

often i need to know if there is a big screen or a small one, so the question is "tablet or mobile phone?".

for ios with can do this with ig.ua.iPhone and ig.ua.iPad, but this feature is missing for android.

i wasted a lot of time in this, the only way to check for a tablet with android is the useragent. since android 3.x ONLY mobile phones have the string "mobile" in their useragent.android 2.3 and older where only developed for phones, so there you can find always "mobile". the last android tablet with 2.3 was the first galaxy tab 2 years ago.

so you can be around 99% percent sure, if you find "android" and NOT "mobile" in the useragent, its a tablet.

dominic plz add ig.ua.tablet :)

1 decade ago by stahlmanDesign

I don't know if it works offline or compiled, but have you looked at Modernizr?

The trend is to no longer detect the make and model, but rather the type of functionality. Instead of "is it Android 2.3", you detect if it can support multitouch, nevermind the OS. Instead of "is it iPhone 5", you ask it how tall the screen is.

1 decade ago by Husten

i dont want to detect the androidversion or other os. i want to detect how big the screen is. and the only way is to check this is to check for tablet or phone.

1 decade ago by mimik

check the
ig.system.width

or just
window.innerWidth;
window.innerHeight;

?

1 decade ago by Husten

thats the size in pixel NOT the size in inch of the device! i need to know for example has the device a 4 inch or a 10 inch screen. and there is no other way than checking for type tablet/phone.
Page 1 of 1
« first « previous next › last »