> > > > as usual you can't tell from the user-agent which iphone model you are > > dealing with. > > There is no reason to think you can - a browser is an application, the > underlying hardware is irrelevant. There is no specification for what > a UA string should contain, it might be anything. > > > > in the past i used a simple 20ms benchmark in javascript to > > distinguish between 2g/3g and 3gs. the idea was formed in a discussion in > > this very group here. > > Do you have an estimate of the percentage of incorrect results? If a > 3gs is busy doing something else when the test runs (say a call is > incoming or some other task runs in the background), likely it will be > misidentified. Changes to the script engine that affect performance > (e.g. so that older models with the update run as fast as new models > without) will likely make things even more difficult. > > We test it thoroughly and found that the difference between the 2G/3G and 3GS model so significant that we could tell the difference. Its hard to test all kinds of scenarios such as very low signal strength that the phone needs to amplify it to be usable. But as I said we tested that intensely of course.
> > var percentmobile_t=new Date().getTime(); > > var percentmobile_s=0; > > while(new Date().getTime()-percentmobile_t<20) > > There is no need to use getTime(), though I doubt it is relevant here. > Subtracting one Date object from another will return the difference in > ms (per ECMA-262): > > Great, this makes sense. You never learn out;) > [...] > > disclosure: i am co-founder of percentmobile.com, a *free* mobile web > > analytics solution and we used the methods like the one above in the past > to > > differentiate between models. > > Hopefully you advise clients of the difficulty of reliably detecting > underlying platforms and provide an estimate of accuracy when > reporting data or statistics. > As I said before we found that be accurate otherwise we would *not* use it. And you always need to take statistics with a grain of salt for reasons ranging from the data set, data point identification, data presentation to agendas. Give it a try if you want and let us know what you think! Open to feedback. Stan -- You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en.
