Does anyone know a way to detect the older set of devices:
From the newer set:
I have found methods to detect the iPhone 4 and the iPad (using screen size). However, is there a way to tell the iPhone 3GS and the iPod touch 3G from the iPod touch 1G and the iPhone 2G?
Requirements:
(Example for the iPhone 2G and iPod touch 1G detection, using a "hidden" method: "iPad and iPhone 3G and later support H.264 Baseline profile 3.1. Earlier versions of iPhone support H.264 Baseline profile 3.0." from https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/AudioandVideoTagBasics/AudioandVideoTagBasics.html).
Edit: There is no way I can get around this requirement: there is no alternative solution besides this detection.
If number crunching would be a discriminator... use it! Just benchmark a small loop (call it BogoMips) and within some 0.5 seconds you know what you are up to.
The hardware and software are defined, the load is pretty much defined (well.. iOS 4 'multitasking'?), so I think it can be very accurate.
edit I only read your remarks on performance testing now; maybe you meant this exactly, maybe you meant to measure page render time. My suggestion is to have a page with only a piece of javascript which then stores the result as a cookie and redirects. Pretty much all circumstances are known then.
Have you looked into the UserAgent string?
For example, my iPhone 4 returns:
Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A306 Safari/6531.22.7
The Mobile/8A306
is the firmware version (just google for 8a306 iphone
I believe the older versions of the phones cannot run the new versions of the OS. So you might be able to find a set of firmware codes that will only show up on the older versions of the phones. This will at least allow you to detect some of the differences.
The WURFL has some good references and user agent strings and how to detect the device and capabilities based on it. There is a browseable list of them, and they might be able to detect the devices correctly. I don't have access to the older hardware, so I can't confirm it works all the time. You can explore what your device shows up as using: http://www.tera-wurfl.com/explore/ And to look at the various UserAgent strings given back.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With