Updated DetectTierIphone() for all Libraries

Hi, folks —

Dan R.’s keen eye spotted an issue with the BlackBerry Style 9670. It was erroneously reported as an iPhone Tier device, when it’s not. (It’s non-touch but does run the new BlackBerry WebKit browser.) Dan suggested a great fix to the DetectTierIphone() which I’ve just uploaded for all four code libraries: PHP, JavaScript, Java and ASP.NET.

In summary, the solution was to ensure in the DetectTierIphone() method that we check for both a BlackBerry WebKit browser and that it’s on a BlackBerry Touch device.

I also made a quick fix to the JavaScript library only for the DetectBlackBerryLow() method. The other libraries were already correctly filtering out BlackBerry WebKit browsers here, but I must’ve forgotten to put that check in the JavaScript library, as well. Sorry about that!

As always, please help me check for errors & bugs. I can do a light test of the PHP and JavaScript code libraries, but I don’t have access to servers to check the APS.NET or Java code libraries. Please let me know if you find something. Much obliged!

Posted in Code Updates, MobileESP APIs

Updated: PHP, JavaScript, Java & ASP.NET

Hi, folks —

Summer is here! And the mobile device avalanche is just about ready to begin in earnest…

There were a few outstanding things that needed to be taken care of, especially some refactoring among the Android detection methods. These were significant changes, so please be sure to review your implementation before upgrading to the latest version!

Here’s a summary of the important code updates. Check the Change Log in the source code for a longer description.

  • DetectIos(): This is a brand new function for all libraries. Returns TRUE for iPhones, iPod Touches, and iPads. The other platforms have a generic check available rather than by screen size class, so I thought it was good to add this in.
  • DetectAndroid(): The purpose of this function has been changed. Now, this method returns TRUE for *any* Android device: phone, multi-media player, tablet, or Google TV. Updated in all libraries.
  • DetectAndroidPhone(): This is a brand new function for all libraries. Its equivalent in the iOS world is DetectIphoneOrIpod(). This method ought to return TRUE for the smaller form factor devices (generally 7″ and less) such as phones and multi-media players (e.g., Samsung Galaxy Player, HTC Flyer). The logic follows Google’s recommendation of checking for the presence of both “Android” and “mobile” in the user agent string.
  • DetectAndroidTablet(): This function has been updated in all libraries. The logic follows Google’s recommendation of checking for the presence of both “Android” but not “mobile” in the user agent string.
  • The various BlackBerry functions: I noted in the code explicitly which ones should return TRUE for the PlayBook and which shouldn’t.
  • HTC Flyer: HTC has released their new 7″ Android tablet. My testing device was purchased at Best Buy last week. The device keeps reporting itself as a desktop Mac — it doesn’t even include the word “Android” in the user agent string. So I added some special checks in the Android methods for this device to ensure it’s detected properly.

As always, please help me check for errors & bugs. I can do a light test of the PHP and JavaScript code libraries, but I don’t have access to servers to check the APS.NET or Java code libraries. Please let me know if you find something. Much obliged!

– Anthony

Posted in Code Updates, MobileESP APIs

Updated: PHP Code

Gary L. pointed out that there was a misspelling in the DetectMobileQuick() function in the PHP code. Unfortunately, the “DetectIpad()” had been spelled with the wrong capitalization. That error is now fixed & uploaded to the code repositories.

(I double checked the DetectMobileQuick() function in the other code libraries, and they all looked fine with the correct spelling.)

However, as Gary also pointed out, I’d accidentally put the year as 2010 in the date stamp at the top of the file. Oops! So I changed the year on the date stamp to 2011 and updated the versions for these code libraries: JavaScript, Java, ASP.NET (both versions).

Thanks, Gary!

Posted in Code Updates

Updated: Better Support for Tablets & WP7 Movement

Hi, folks!

This is just a quick note to let you know that I updated the MobileESP code to provide better support for tablets.

I also made an update regarding Windows Phone 7 whose Internet Explorer 7-based browser isn’t great. It’s definitely not in the same league as iPhone & Android despite initial optimism. Hopefully, when the IE 9-based update is pushed to devices in late 2011, it will live up to expectations at last.

Here’s a quick list of updates for this rev:

  • PHP and Java only: Added a stored variable ‘isTierTablet‘.
  • All: Added a new DetectTierTablet() function. This will detect all of the larger screen (minimum 8 inches) devices with HTML 5 support. These larger tablets ought to be able to share the same special web site design, if you decide to do something special for them.
  • All: Added a new DetectBlackBerryTablet() function. This will detect the BlackBerry Playbook.
  • All: Added a new DetectAndroidTablet() function. These should be at least 8″ and run Honeycomb or later to be considered. Right now, the only useragent we could find was for the Motorola Xoom. As other tablets launch (especially the Samsung and LG tablets), we’ll keep this one updated.
  • All: The DetectAndroid() function was modified to exclude Android tablets. You want to show a Motorola Xoom the same version of your site as you would an iPad (either specially formatted or your regular site). You may NOT want to show a Xoom a that small screen, iPhone/Nexus One-optimized page.
    • It’s our current position that 7″ tablets like the original Galaxy Tab should probably be given a web page that has been optimized for the iPhone/Nexus One, if available, rather than an iPad page. This opinion is due to screen size. In portrait mode, it simply isn’t very wide.
  • All: Moved Windows Phone 7 from iPhone Tier to Rich CSS Tier. Sorry, Microsoft, but IE 7 simply isn’t good enough.

It seems that I often forget a colon, a }, or some other silly error when I do these updates. So please be sure to let me know if you find any errors!

We’ll continue to monitor the tablet scene for the next crop of great Honeycomb-based tablets, plus the launch of the HP WebOS-based ones. As soon as we can get our hands on some useragent strings, we’ll update the code as necessary.

Special thanks to Justin M., Peter V., & Marc L.! Thanks for your help & support, guys!


FYI: This page has been translated into Serbo-Croation: http://science.webhostinggeeks.com/mobilni-dizajn

Posted in Code Updates, Mobile Web Site Design, MobileESP APIs

On Hiatus for Winter Holidays

This is just a quick note to let you know that I’m taking a few weeks off for the holidays. And to move to Silicon Valley! It’s a new job with a large consumer electronics company in their new mobile R&D lab. Very cool…

I have a minor fix lined up soon to address what happens if there isn’t a UserAgent property in the request string. (Apparently, it can happen rarely with PHP in particular.)

A kind reader has suggested a significant re-architecture of the .NET code to make it more efficient, as well. That one will require some time… And some debugging! When it’s ready for testing, I’ll post a notice on here to request volunteers.

Plus, goodness knows there’s been a slew of new mobile devices launched at CES 2011 — tablets in particular. And Mobile World Congress (MWC) is coming up in a few weeks in Barcelona. So I’m sure we’re going to need to make a few tweaks for some of the new devices. Please let me know if you see anything that needs updating as a result of all of this activity.

Until then, happy & safe mobile computing!


Posted in General

MobileESP Live Demos Now Available: PHP & JavaScript

We took advantage of this long Thanksgiving holiday weekend to put together two comprehensive demos of the MobileESP APIs. Now you can see not only all of the available function calls listed and grouped in one handy list, but you can also see what your device would return for each method. The demo pages are LIVE with the latest version of the code!

Just point your mobile device to one of the two live demo pages below:

You can also access the live demo pages any time by clicking on the “Live API Demos” link in the Pages navigation section.

Posted in General, MobileESP APIs

Updated: Added Support for Google TV

Now that GoogleTV devices have been publicly released, it’s time to update the MobileESP code bases with support for it. We’ve added a new method for detecting Google TV in the Android section:


This method is now available for PHP, JavaScript, Java, ASP.NET (C#) and Ruby. See the Downloads page for download instructions & links.

Posted in Code Updates, MobileESP APIs

MobileESP: Ported to Ruby!

One of the web developers using MobileESP has ported the code library to Ruby. How cool is that?!?

If you’re a Ruby enthusiast, you can download the latest version of MobileESP from GitHub at:


Martin has made a few tweaks to the code library to better match Ruby programming patterns. One of the cool Ruby-esque things he’s done is provide aliases to the function names. So for example, the “DetectXXX” function also has an “is_XXX” alias.

We’re grateful for Martin’s contribution to expanding the MobileESP platform coverage and his ongoing maintenance of the Ruby codebase.

Thanks a ton for taking the initiative on this, Martin!

Posted in General, MobileESP APIs, Projects Using MobileESP

Updated: Disambiguate between ‘PDA’ and ‘Update’

This afternoon, we got an alert from Ilia with a suggested fix. Ilia pointed out that the algorithm which detects for a device using “PDA” in its user agent string will also be triggered when it encounters the word “update” (or “autoupdate”). This issue is encountered with some clients which have Adobe software installed. Here is an example of the offending useragent:

“Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Creative AutoUpdate v1.40.01)”

So I made an update to the DetectMobileQuick() method in all code libraries: PHP, JavaScript, Java, and .NET.

QA Note: I was able to do a casual test with the PHP and JavaScript codes and they appear to be working. If you see an error in the Java or .NET versions, please let me know. (And of course if you see ANY errors or the need for any tweaks, please send me a note!)

Posted in Code Updates

Test your device!

We published a device detection page on the Hand Interactive web site. It doesn’t test all of the API methods at this time, just some of them. A web page to provide results for all of the API methods is coming soon!

Follow this link: www.hand-interactive.com/detect/

If a mobile device is detected, it’ll automatically show you the mobile version of the page. Otherwise, you’ll get the desktop version.

Posted in General

Updated: Added Support for BlackBerry OS 6

BlackBerry launched the new Torch on August 3, the first device running the new OS 6 with a brand new WebKit-based browser. At last! A first class browser finally makes it to the BlackBerry platform!

Word on the street is that the new OS 6 WebKit browser is in the iPhone class. So, optimistically, we updated the MobileESP code with the following updates.

  • DetectBlackBerryWebKit(): Added a new method to detect for BlackBerry OS 6 devices.
  • DetectBlackBerryTouch(): Added detection for the Torch device.
  • DetectBlackBerryHigh(): Updated to explicitly exclude BlackBerry OS 6 devices. This method is reserved for devices with a “highly capable” OS 5 browser.
  • DetectTierIphone(): Updated to include detection for the new BlackBerry OS 6 method.

This is the useragent string that BlackBerry announced for the new Torch device:

Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, Like Gecko) Version/ Mobile Safari/534.1+
Posted in Code Updates

Updated: Added Support for Windows Phone 7

I recently got my hands on the Windows Phone 7 SDK from Microsoft. The browser in the device emulator appears to support most or all of the CSS and JavaScript features you would expect for an iPhone Tier device. (The iPhone Tier devices include the iPhone, naturally, but also the native browsers for Android, WebOS and a few others.)

So now seemed like a good time for a preliminary update of the MobileESP code to support Windows Phone 7!

Here is a list of code updates to support Windows Phone 7 device detection. The code bases for each of the platforms have been updated using the same API signatures.

  • deviceWinPhone7: New field for storing a useragent string unique to Windows Phone 7.
  • DetectWindowsPhone7(): New method for detecting a Windows Phone 7 device.
  • DetectWindowsMobile(): Modified to disambiguate Windows Phone 7 devices from Windows Mobile 6.xx and earlier devices. This method excludes Windows Phone 7 due to the significant gap in capabilities between the 6.xx and 7 versions.
  • DetectSmartphone(): Updated to include Windows Phone 7.
  • DetectTierIphone(): Updated to include Windows Phone 7.
Posted in General