0

I wonder how other people handle this issue, and can't seem to find a definitive answer.

I am doing a JSP redirect for a mobile version of a website, and things are working fine for other platforms, but Android presents an issue. According to the comments in the answer of this post, can one really infer that simply targeting mobile in the User Agent string will target Android devices and exclude all Android tablets? I would love to hear a resounding "YES!", but would also like to hear different angles on this.

I was considering using screen resolution if the User Agent string contains android, but am wondering how much longer that will continue to be a good gauge. We are seeing a variety of tablets that don't have the real estate of an iPad, but are definitely bigger than a Smartphone size. I also think it won't be long before we see phones with resolutions of 1280x800, considering some of the in-between devices we are starting to see.

Community
  • 1
  • 1
Dallas
  • 542
  • 1
  • 8
  • 19
  • I am aware that the iPad UA has _mobile_ in it as well, and am asking just in the context of: if _android_ is in the UA string. – Dallas Nov 18 '11 at 17:37

1 Answers1

2

According to the comments in the answer of this post, can one really infer that simply targeting mobile in the User Agent string will target Android devices and exclude all Android tablets?

Well, it's what Google tells you to do.

I would love to hear a resounding "YES!"

<resounding>YES!</resounding>

(moving this into a <span> with resounding CSS is left as an exercise for the reader)

We are seeing a variety of tablets that don't have the real estate of an iPad, but are definitely bigger than a Smartphone size.

That's probably difficult to address via a pure server-side redirect. There are instructions for targeting different screen sizes for Web apps, but they assume you're doing the work on the client. The mobile or not is a very coarse-grained solution. I'm not aware of a reliable user-agent way to determine screen sizes or densities.

I also think it won't be long before we see phones with resolutions of 1280x800

The HTC Rezound is 1280x720 (i.e., 720p), as is the Galaxy Nexus, AFAIK.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Given the Rezound's resolution, and the fact that I probably still want to serve it the mobile version, it sounds like I don't want to use resolution. Also... I didn't know for sure that there wasn't a server-side way to determine screen size/density. Thanks for that! – Dallas Nov 21 '11 at 13:50