Page 1 of 2
"resolution_width" capability behavior is weird.
Posted: Mon Jul 06, 2015 1:27 am
by virendrad
Hi,
I found that "resolution_width" capability is giving some incorrect information. As, for example,
For Google Nexus 4 it is 768 and the same is returned for Apple iPad and Apple iPad Mini. And on the other side for iPhone 6 it gives 640 and Galaxy note 3 it is 1080.
There is something fishy going on over here. I assume for Apple devices, it doesn't provide screen resolution size, but for others it does. I am interested in screen size not the resolution.
I have following question,
1. Why it is behaving differently for android and apple?
2 . Can you provide me the name of the capability which actually provide screen size, not the resolution for all devices. I searched a lot but didn't find such capability which does the job for me.
An early and prompt response will be highly appreciated.
Thanks,
Virendra
Re: "resolution_width" capability behavior is weird.
Posted: Mon Jul 06, 2015 4:59 am
by virendrad
Or if you can tell me something similar to min-device-width used by CSS media queries then that would be great.
Re: "resolution_width" capability behavior is weird.
Posted: Mon Jul 06, 2015 9:47 am
by Elliotfehr
Virendra,
From what you have mentioned, you are looking for the capabilities `physical_screen_width` and `physical_screen_height`, which will return the width of the screen in millimeters.
The discrepencies that you are finding between Apple and Android devices is due to how Apple has chosen identify their devices in their User Agent string. They have chosen to mask the underlying device information, making it very difficult to determine the specific iPhone model and thus making it difficult to determine the exact screen dimensions of the device.
Thank you,
Elliot
Re: "resolution_width" capability behavior is weird.
Posted: Mon Jul 06, 2015 11:57 pm
by virendrad
Elliot,
Thanks for your response. But "physical_screen_width" is not going to solve the my problem. As for Nexus 4 it comes 62M and when you convert it into pixel by multiplying by 3.77 then it comes around 233.74 which is again not correct. I want something similar to what I am currently using with CSS3 media queries.
With CSS media queries, we have min-device-width specified in pixel, do we have similar capability.
Thanks,
Virendra
Re: "resolution_width" capability behavior is weird.
Posted: Tue Jul 07, 2015 12:01 am
by virendrad
I am actually interested in find out the CSS width as mentioned on below link.
http://mydevice.io/devices/
And let me know if its possible to get pixel ratio via any way. If I can get the pixel ratio, then dividing resoultion_width with pixel ratio will give us CSS width.
Thanks,
Virendra
Re: "resolution_width" capability behavior is weird.
Posted: Wed Jul 08, 2015 10:59 am
by Elliotfehr
Virendra,
It is important to keep in mind that the CSS pixel dimensions may not be necessarily be calculated in this fashion. I would recommend using the `resolution_width` and `resolution_height` to determine the dimensions of the device.
Here is an explanation in regards to the CSS pixel dimensions.
Thank you,
Elliot
Re: "resolution_width" capability behavior is weird.
Posted: Wed Jul 08, 2015 11:42 pm
by virendrad
Hi Elliot,
Thanks for your reply. First, the URL is missing from your last reply. Also, my requirement is to detect the rendering surface width and then decide the image size. For example, If I am viewing on iPhone 4s then the image size would be 320px and when I am viewing it on Nexus 4, it would be 384px.
And if I go by resolution width, then how can I get to the figure of 384 where 768 is returned via Scientia Mobile. I can't use 768px image size over there as the rendering surface is only of 384px. Or it would be great if you can tell me how to handle this scenario.
Thanks,
Virendra
Re: "resolution_width" capability behavior is weird.
Posted: Thu Jul 09, 2015 7:51 pm
by Elliotfehr
Virendra,
I would recommend using the `max_image_width` capability in this case. However, it is importan to keep in mind that due to how Apple has chosen to identify their devices, it is very difficult to determine the specific iOS model and thus difficult to determine the exact dimensions you are looking for (for Apple devices). However,
wurfl.js will allow you to determine the exact iPhone model if you would like to target them individually.
I will also mention, that we do offer the
WURFL Image Tailor (WIT), which does allow for dynamically resizing images in this fashion.
Thank you,
Elliot
Re: "resolution_width" capability behavior is weird.
Posted: Wed Jul 15, 2015 11:44 pm
by virendrad
Hi Elliot,
"max_image_width" property is also giving incorrect result for desktop. My desktop screen resolution is 1280*1024 where "max_image_width" returns 600. And "max_image_height" also returns 600. Now why is that? And for iPad it returns 768*1024.
It is quite confusing. Can you please throw some more light on this.
Thanks,
Virendra
Re: "resolution_width" capability behavior is weird.
Posted: Thu Jul 16, 2015 8:55 am
by Elliotfehr
Virendra,
For desktop devices, the WURFL API will fall back on its default value as it is not possible to tell what type of monitor the end user is using with HTTP headers alone.
Are you able to let me know the value you are expecting for your iPad as well as provide me with the User Agent?
Thank you,
Elliot
Re: "resolution_width" capability behavior is weird.
Posted: Fri Jul 17, 2015 2:22 am
by virendrad
Thanks Elliot for reply and that make sense to me.
Request you to please confirm the default values for desktop for these four capabilities
max_image_width - I am getting 600
max_image_height - I am getting 600
resolution_width - I am getting 800
resolution_height - I am getting 600
So these values are fixed and not going to change for desktop, irrespective of screen resolution, make and model. Can you please confirm this.
And for your question regarding IPAD, it is returning 768x1024. And that is correct, I guess.
Thanks,
Virendra
Re: "resolution_width" capability behavior is weird.
Posted: Fri Jul 17, 2015 2:23 pm
by Elliotfehr
Virendra,
I have just updated the values of these capabilities to return a width of 800 and height oof 600 for both of them, which will be available in the next wurfl.xml release this Sunday.
Thank you,
Elliot
Re: "resolution_width" capability behavior is weird.
Posted: Sun Jul 19, 2015 10:36 pm
by virendrad
Elliot,
I believe all the 4 capabilities will remain same for all the desktop models irrespective of screen resolution, make and model. Please confirm.
BTW, I am still seeing 600 returned by max_image_width.
Re: "resolution_width" capability behavior is weird.
Posted: Mon Jul 20, 2015 9:28 am
by Elliotfehr
Virendra,
Are you able to provide me with the User Agent of the device that is returning this?
Thank you,
Elliot
Re: "resolution_width" capability behavior is weird.
Posted: Mon Jul 20, 2015 11:51 pm
by virendrad
Elliot,
First, please confirm this, "all the 4 capabilities will remain same for all the desktop models irrespective of screen resolution, make and model."
Here is the user agent string.
In Mozilla - Mozilla/5.0 (Windows NT 6.3; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0
In Chrome - Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36
Regards,
Virendra
Re: "resolution_width" capability behavior is weird.
Posted: Tue Jul 21, 2015 1:51 pm
by Elliotfehr
Virendra,
This will be correct for any desktop device as a `generic_web_browser` since desktop devices use external monitors and do not have any identifying characteristics in the HTTP header alone.
I am seeing a width of 800 for both of these User Agents with the latest wurfl.xml release (this past Sunday). You may need to reload the WURFL file in order for the change to be reflected.
Thank you,
Elliot
Re: "resolution_width" capability behavior is weird.
Posted: Wed Jul 22, 2015 12:20 am
by virendrad
Hi Elliot,
I am still seeing 600 returned by "max_image_width" though resolution width returns 800. I am not able to attach the screenshot as I am getting an error "Could not upload attachment to ./files/1012_55d665b4bf006df8eb0f5115162d3fb3.". I have cleared all my cookies, but still seeing the same result.
I have also tested the same user agent string on
http://tools.scientiamobile.com/?user-a ... i%2F537.36 but here I can see only resolution_width,
not max_image_width.
Just to let you know that I am using the Cloud API, WURFL.xml is not downloaded on my machine. I am getting this value from WURFL cloud.
Also, I noticed another thing that max_image_width for iPhone 6 is returning 320 where it should return 375px. And it is returning the same value for iPhone 6 Plus. It should return 414px. Can you please also check it and revert?
Thanks,
Virendra
Re: "resolution_width" capability behavior is weird.
Posted: Thu Jul 23, 2015 9:53 am
by Elliotfehr
Virendra,
The WURFL cloud was recently updated in all regions and you should now see the updated results for width/height.
Please keep in mind that iOS devices do not identify the underlying device hardware, making the iPhone 6 and iPhone 6 Plus very difficult to distinguish using HTTP headers alone. Our
WURFL.js service does allow for better iOS detection and the resolution_width/resolution_height capabilities are available in the Business Edition.
Thank you,
Elliot
Re: "resolution_width" capability behavior is weird.
Posted: Mon Jul 27, 2015 1:04 am
by virendrad
Hi Elliot,
I can see that max_image_width now returns 800. Thank You.
Regarding your point, "Please keep in mind that iOS devices do not identify the underlying device hardware, making the iPhone 6 and iPhone 6 Plus very difficult to distinguish using HTTP headers alone." I understand that. But is it not possible to update these values for all iPhone models to return the correct logical resolution like you did for "max_image_width" for desktops. Same way, you can update these values for all iPhone models. Just a suggestion.
Regarding your suggestion for using "WURFL.js service", that is not suitable for us because we want to detect things on the server side, not client side. And it's not even ideal to use cloud API for other models and "WURFL.js" for iOS models.
Also, let me know if it is possible to detect the Device name/ model name and type. Like iPhone 4, iPhone 4S, iPhone 6, Samsung Galaxy Note 3. If yes, then which capability to use.
There is no point for us to purchase a license for WURLF cloud API if we can't get correct and desired result for all models including iOS.
Thanks,
Virendra
Re: "resolution_width" capability behavior is weird.
Posted: Mon Jul 27, 2015 11:06 am
by Elliotfehr
Virendra,
Unfortunately, this is not possible due to the fact that Apple does not provide this information and has gone to great lengths to mask this from their HTTP headers. If you are interested in the model name of the device, I would recommend using the `model_name` or `complete_device_name` capabilities to retrieve this from the request.
Thank you,
Elliot