Change mobile/tablet detection (classic ASP)

tobzzz
tobzzz used Ask the Experts™
on
I have a detection script:
http://blog.trsdesign.com/2012/02/mobile-detection-in-classic-asp/

It basically goes through an array checking against the HTTP_USER_AGENT (I think), and if there's a match it decides it's a portable device.

What I need to do is break it down so I can see if it's mobile phone or a tablet. However, I don't know what brands do what or if there's overlap: I mean, for example, "android" is in the array but android is on both tabs and phones!

There's also this line:
"(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|windows ce|pda|mobile|mini|palm)"

Most of which sound like pda's or phones but I don't know all of them, windows ce is tablet or just mobile? What is mmp? What is midp? etc......

So, has anyone had experience with this? I only want fully confident answers here, please!

Thanks experts,

/ Tobzzz
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Developer
Commented:
Oh if only life were so simple!

Browser sniffing using the User Agent has always been unreliable, even when it was just attempting to detect major browser versions.
Trying to detect just mobile devices is harder, with all their different browsers. Trying to detect the difference between phones an tablets will be even harder.

What makes it even harder is the release of phones with bigger screens - the new HTC One X has an 1024x768 screen size - there are plenty of tablets with screens this size. Do you want to treat it as a phone or a tablet?

If you are doing this so you can present an optimised site to different users, then there are better ways of doing it.

A fluid web design, where the page layout changes according to the screen resolution is far more effective, and much easier to maintain once you've built it. It also means there are no duplicate content issues with Google.

For a good example, take a look at http://hicksdesign.co.uk/journal/finally-a-fluid-hicksdesign
Try resizing your browser and see what happens to the page layout as you do.
The site has obviously been updated since this article was written, as all the sections, not just the journal works like this - despite what the article says.

Have a look in http://hicksdesign.co.uk/css/layout.css for how it's done.

Author

Commented:
Hi Cyber-spy,

It's not the answer but I like the article and I like the info so awarding the points as no one else has contributed. Thanks for you time on this.

/ Tobzzz

Author

Commented:
Thanks anyway
AdamSenior Developer

Commented:
No problem - have fun building your site! ;-)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial