

Ask HN: What is the best way to detect mobile devices? - neya

Hi HN Community,&#60;p&#62;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.&#60;p&#62;Is there any other better way/technique to detect mobile devices &#60;i&#62;efficiently&#60;/i&#62; ? 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?? :)&#60;p&#62;Thanks,
Neya
======
itsprofitbaron
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/>

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

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

