How do detect Android Tablets in general. Useragent?
I have looked everywhere. We are using a Motorola Zoom to try our tablet site testing. The issue is that the Android Useragent is a general Useragent and there is no difference between tablet Android and mobile Android. I don't want to just target a specific device like the Xoom Useragent since Android will most likely be on multiple tablet devices in the near future.
We are using Umbraco CMS, and we have looked at using the 51Degrees.mobi solution, and at this moment this will not work for our needs. Maybe in the future. I know 51Degrees and some of the people at Umbraco are going to be doing some integration into Umbraco, but the final project will probably not be out for a couple of months.
Hence, why we would like to detect the Useragent String of an Android tablet and have it not direct to our mobile site like it currently is.
If anyone knows how to detect and Android Tablet in general, not the specific device would be very helpful.
The issue is that the Android User-Agent is a general User-Agent and there is no difference between tablet Android and mobile Android.
This is incorrect. Mobile Android has "Mobile" string in the User-Agent header. Tablet Android does not.
But it is worth mentioning that there are quite a few tablets that report "Mobile" Safari in the userAgent and the latter is not the only/solid way to differentiate between Mobile and Tablet.
@Carlos: In his article Tim Bray recommends this (as does another post by Google), but unfortunately it is not being applied by all tablet manufacturers.
... We recommend that manufactures of large-form-factor devices remove "Mobile" from the User Agent...
Most Android tablet user-agent strings I've seen use mobile safari, e.g. the Samsung Galaxy Tab:
Mozilla/5.0 (Linux; U; Android 2.2; en-us; SCH-I800 Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
So at the moment I am checking on device names to detect Android tablets. As long as there are just a few models on the market, that's ok but soon this will be an ugly solution.
At least in case of the XOOM, the mobile part seems to be gone:
Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13
But as there are currently only tablets with Andorid 3.x, checking on Android 3 would be enough.