Hi, folks —
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.
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.
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.)
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
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!
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.
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:
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!
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)”
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/18.104.22.168 Mobile Safari/534.1+
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.