Hacker News new | comments | show | ask | jobs | submit login
Ask HN: What is the best way to detect mobile devices?
4 points by neya 1702 days ago | hide | past | web | 3 comments | favorite
Hi HN Community,<p>I'm an experienced web-developer who is just trying to create websites that display well on any screen/device (Responsive design). I know of CSS Media Queries, U/A sniffing and Device Description repositories like WURFL.<p>Is there any other better way/technique to detect mobile devices <i>efficiently</i> ? I could use a Javascript solution, but that will not really let me find out info about legacy phones or phones with poor JS support. What do you use personally to detect mobile devices? Could you please share, so everyone will benefit from it?? :)<p>Thanks, Neya

Since you're going for a responsive design, you should definitely look at the available screen real estate. The reason for this is because, it allows you to display your responsive design without worrying about not detecting new devices - which is why I personally believe trying to detect User Agent strings will become out of date.

This article is pretty useful: http://www.html5rocks.com/en/mobile/mobifying/

Thank you for the link, at a quick glance, it looks like it uses CSS Media Queries though? I'll have a look...thanks :)

Yeah they use CSS Media queries, its the easiest method to detect them especially for a responsive design

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact