> Hey,

Hi !

> as usual you can't tell from the user-agent which iphone model you are 
> dealing with. 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.
> 
> var percentmobile_t=new Date().getTime();     
> var percentmobile_s=0;
> while(new Date().getTime()-percentmobile_t<20)
> {
>       Math.random();
>       percentmobile_s++;
> }
> var model=(percentmobile_s>1000)?"3gs":"2g3g";
> 
> this worked well and i expected to be able to do something similar for the 
> new device. didn't work. within the 20ms both create between 1500-2400 random 
> numbers. i tried creating some other objects such as images or DOM nodes, but 
> same thing, the browser performance is not distinguishable. does anyone of 
> you have an idea what else to try?

humm…. kind of a strange detection system but well, if it works, why not :) Why 
didn't you use user-agent or browser version?

> i was also trying to do it by detecting the new display resolution, but 
> without luck. i always get 320x480 and never 640x960. is there any way to get 
> to the 640x960 in javascript?

screen.width ?

> 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.

Just sign-in :)

R.

-- 
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.

Reply via email to