WURFL Cloud returning wrong results for resolution_width

Questions about the WURFL Cloud service.
markAv
Posts: 1
Joined: Wed May 16, 2012 5:46 am

WURFL Cloud returning wrong results for resolution_width

Postby markAv » Wed May 16, 2012 5:53 am

Hi there,

I've set up a free account to test WURFL cloud.

following the php example, i have connected to the api no problem.

When i try to grab these two properties though :

Code: Select all

$WURFLWidth = $client->getDeviceCapability('resolution_width');
$WURFLHeight = $client->getDeviceCapability('resolution_height');
both are returned incorrectly as 800 for width, and 600 for height

The values i am expecting are 1680(w) and 1050(h)

Does anyone have any ideas why these might be incorrect ?

Thanks

php is below:

Code: Select all

<?php
// Include the WURFL Cloud Client
require_once 'WURFL/Client/Client.php';

// Create a configuration object 
$config = new WurflCloud_Client_Config(); 
 
// Set your WURFL Cloud API Key 
$config->api_key = '123459:dnYaEJfeuqmRp41DcyxrWU5SCv6jthON';  
 
// Create the WURFL Cloud Client 
$client = new WurflCloud_Client_Client($config); 
 
// Detect your device 
$client->detectDevice(); 
 
// Use the capabilities 
if ($client->getDeviceCapability('ux_full_desktop')) { 
    echo "This is a desktop web browser"; 
} else { 
    echo "This is a mobile device";
	
}

$WURFLWidth = $client->getDeviceCapability('resolution_width');
$WURFLHeight = $client->getDeviceCapability('resolution_height');
	
	echo $WURFLWidth;
	echo $WURFLHeight;   
 
?>

luca.passani
Posts: 65
Joined: Thu May 19, 2011 2:49 pm

Re: WURFL Cloud returning wrong results for resolution_width

Postby luca.passani » Wed May 16, 2012 6:24 am

Hi there,

If you are connecting with a web browser, the WURFL Cloud will simply return information related to the generic assumption that you are accessing the service with a web browser and return (conservative) values about the size of the actual browser window. It seems to me that this is what you are observing.

You need to connect with a mobile device. That's where the value of the Cloud is found.

If you know it's a web browser, you can easily calculate the size with javascript the way developers have done it for centuries :)

To be clear, we could go out of our way to have the system piggy-back javascript-generated viewport info into the request to the cloud, just to provide it back in the response as if it came from the Cloud. This might make be presented as a cool feature, but it wouldn't help much in practice though. Developers will still need to understand what is going on for real to regain control of their user-experience.

In general, anything that tries to blur the difference between mobile and desktop is going to backfire for anyone whose ultimate goal is to have control over the UX that they deliver to end-users.

Thanks

Luca

Jan.Sobota@bsc-ideas.com
Posts: 3
Joined: Mon Aug 06, 2012 5:02 am

Re: WURFL Cloud returning wrong results for resolution_width

Postby Jan.Sobota@bsc-ideas.com » Mon Aug 06, 2012 5:11 am

Hi there,
I want to detect HTC wildfire browser Opera which has width 240 and resolution_width 320 is detected. It is with Opera Mobile browser.
The request.getHeader("User-Agent") is Opera/9.80 (Android 2.2.1; Linux; Opera Mobi/ADR-1205181138; U; cs) Presto/2.10.254 Version/12.00
is it possible to fix this problem ?

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: WURFL Cloud returning wrong results for resolution_width

Postby kamermans » Mon Aug 06, 2012 10:59 am

Hi,

This is a side effect of the way Opera Mobile (and Opera Mini) represent themselves in their User Agents. Specifically, Opera Mobi user agents do not provide information about the underlying device (HTC Wildfire), so we are forced to return a reasonable value for the width, which, in the case of the Wildfire, is wrong. One option for you is to use the mobile_browser capability to check if the device is detected as "Opera Mobi", and act accordingly. This problem should be prevalent only on older Android devices running Opera Mobile. Are you using Opera Mobile yourself, or is this for the sake of testing?
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!

Jan.Sobota@bsc-ideas.com
Posts: 3
Joined: Mon Aug 06, 2012 5:02 am

Re: WURFL Cloud returning wrong results for resolution_width

Postby Jan.Sobota@bsc-ideas.com » Tue Aug 07, 2012 7:29 am

This is for the sake of testing.

sm_support2
Posts: 294
Joined: Mon Jun 20, 2011 5:04 pm

Re: WURFL Cloud returning wrong results for resolution_width

Postby sm_support2 » Tue Aug 07, 2012 8:09 am

Jan.Sobota@bsc-ideas.com wrote:This is for the sake of testing.
Unfortunately, Opera makes it really hard for WURFL (and for everyine else) to detect the host device. Anyway, I recommend that you check back in a few months. We may be able to introduce some nice new feature in the meantime

Jan.Sobota@bsc-ideas.com
Posts: 3
Joined: Mon Aug 06, 2012 5:02 am

Re: WURFL Cloud returning wrong results for resolution_width

Postby Jan.Sobota@bsc-ideas.com » Wed Aug 08, 2012 9:11 am

We tested it on Blackbarry 9360 also. The result was : on Opera mini: 176 on default browser: 480.
Does it mean that response from any device with opera mini will detect width as 176 and opera mobile as 320 ?

sm_support2
Posts: 294
Joined: Mon Jun 20, 2011 5:04 pm

Re: WURFL Cloud returning wrong results for resolution_width

Postby sm_support2 » Wed Aug 08, 2012 10:03 am

Jan.Sobota@bsc-ideas.com wrote:We tested it on Blackbarry 9360 also. The result was : on Opera mini: 176 on default browser: 480.
Does it mean that response from any device with opera mini will detect width as 176 and opera mobile as 320 ?
Opera Mini will place the UA string of the built-in browser (or something that is usually similar enough) in the x-operamini-phone-ua HTTP header. This means that a relatively simple change in the code will allow you to opt for device detection as opposed to browser detection.
Admittedly, this requires a rebuild (ot at least a change in the code) and is not ideal. We are working on removing this obstacle in the next major release of the WURFL APIs.

Thank you

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: WURFL Cloud returning wrong results for resolution_width

Postby kamermans » Wed Aug 08, 2012 9:25 pm

One quick clarification, with the WURFL Cloud service, detection of the device will take priority in the case of Opera Mini when the X-OperaMini-Phone-Ua header is present in the HTTP request (this is normally the case), and you use the WURFL Cloud Client in such a way that it has access to the entire incoming HTTP request (this is the default example). One notable use-case that breaks the second rule is when batch-processing logged user agents, since you only have access to the user agent.
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!


Who is online

Users browsing this forum: No registered users and 15 guests