How do detect Android Tablets in general. Useragent?

ClosDesign picture ClosDesign · Mar 17, 2011 · Viewed 156.8k times · Source

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.

Answer

CommonsWare picture CommonsWare · Mar 17, 2011

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.