devXero's blog

a blog about agile, development, and automation

  • tweets

    Error: Twitter did not respond. Please wait a few minutes and refresh this page.

  • photo

  • Advertisements

Mobile Browser Sniffing

Posted by Mike Longin on August 10, 2010

For my internal site, I wanted to give it the ability to display an version specific for mobile browsers. To do this required the ability to sniff our a mobile browser. Initially I was using the provided .Net command for verifying if the accessing browser was a mobile browser.


However while this works great for the iPhone this did not work at all for Android based devices. After a large amount of searching I found the MobileESP open source project ( for determining if a browser is from a mobile device. Initially I used thier entire code base. However I felt that solution was too bulky and I ended up just finding the code for locating an Android based device and using that instead.

Request.UserAgent.ToLower().IndexOf("android") != -1

Even if you do not need their entire code base, the project is a great repository for determining how to identify any mobile based browser


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: