Tablet Detection
-
- Posts: 4
- Joined: Mon Jun 11, 2012 9:54 am
Tablet Detection
Is there a better way to determine if a device is a tablet? I use the IsDesktopHeavyDutyAnalysis() method first to get the main IsMobile, IsDesktop, IsSmartTV flags, then I am trying to use GetCapabilities() to help determine if the device is a tablet. My issue is that "is_tablet" is sparsely populated, and the random sampling of tablets shows that this field is not present (ipad, samsung galaxy, etc.).
Re: Tablet Detection
I'm assuming you're using the PHP API or the DB API? The IsDesktopHeavyDutyAnalysis() method is meant for internal use only, and it's return value is neither deterministic, nor necessarily accurate (basically, you shouldn't use it ). Because of the fallback hierarchy, it's impossible for a capability to be sparsely populated or unpopulated. If you are seeing this behavior when using the normal methods of accessing the API, there is a critical bug. I suspect you've used the internal method that grabs the raw device definition from WURFL and returns it, before the fallback hierarchy populates the non-explicitly defined capabilities.
If you can provide me with a code snippet that shows how you are using the API, I will modify it for you so it works properly.
If you can provide me with a code snippet that shows how you are using the API, I will modify it for you so it works properly.
Thanks,
Steve Kamerman
ScientiaMobile
Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!
Steve Kamerman
ScientiaMobile
Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!
-
- Posts: 4
- Joined: Mon Jun 11, 2012 9:54 am
Re: Tablet Detection
I am currently using the .NET API to parse our list of known UA strings. This code is located inside an SSIS package, and the method Browsers_ProcessInputRow(...) runs once for each UA string. The PreExecute() method is run when we begin the processing of the rows. Basically, we are attempting to categorize the UA strings into well defined groups (ie: this string is Desktop, this string is Mobile, this string is Tablet, this string is Robotic). The UA strings in question are from both mobile and desktop traffic.
Code: Select all
using System;
using System.Data;
using System.Collections;
using System.Collections.Generic;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;
using WURFL;
using WURFL.Request;
using WURFL.Commons;
using WURFL.Aspnet;
using WURFL.Aspnet.Extensions.Config;
[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
{
private WURFLManager mgr = null;
public override void PreExecute()
{
base.PreExecute();
WURFL.Config.InMemoryConfigurer configurer = new WURFL.Config.InMemoryConfigurer();
configurer.MainFile("H:\\wurfl.xml");
configurer.SetMatchMode(MatchMode.Accuracy);
mgr = (WURFLManager)WURFLManagerBuilder.Build(configurer);
}
public override void PostExecute()
{
base.PostExecute();
}
public override void Browsers_ProcessInputRow(BrowsersBuffer Row)
{
WURFLRequest req = new WURFLRequest(Row.UserAgent);
Row.IsDesktop = req.IsDesktopBrowserHeavyDutyAnalysis;
Row.IsMobile = req.IsMobileRequest;
Row.IsSmartTV = req.IsSmartTvRequest;
Row.IsBot = req.IsBot;
var deviceInfo = WURFLManagerBuilder.Instance.GetDeviceForRequest(req, MatchMode.Accuracy);
try
{
if (deviceInfo != null)
{
Row.DeviceFallbackId = deviceInfo.FallbackId.Substring(0, (deviceInfo.FallbackId.Length > 255 ? 255 : deviceInfo.FallbackId.Length));
Row.DeviceId = deviceInfo.Id.Substring(0, (deviceInfo.Id.Length > 255 ? 255 : deviceInfo.Id.Length));
Dictionary<string, string> capabilities = (Dictionary<string, string>)deviceInfo.GetCapabilities();
foreach (KeyValuePair<string, string> capability in capabilities)
{
BrowserDeviceCapabilitiesBuffer.AddRow();
BrowserDeviceCapabilitiesBuffer.BrowserID = Row.BrowserID;
BrowserDeviceCapabilitiesBuffer.CapabilityKey = capability.Key;
BrowserDeviceCapabilitiesBuffer.CapabilityValue = capability.Value;
}
}
}
catch (Exception e)
{
Row.IsError = true;
Row.ErrorMsg = e.ToString();
}
}
}
Last edited by kamermans on Mon Jun 11, 2012 12:04 pm, edited 1 time in total.
Reason: edited code formatting
Reason: edited code formatting
-
- Posts: 4
- Joined: Mon Jun 11, 2012 9:54 am
Re: Tablet Detection
One other thing I should mention, when I did analysis using only the .IsDesktop method (instead of .IsDesktopHeavyDutyAnalysis), the results skewed the mobile population way out of proportion, it appeared that identifying something as mobile was preferred by the API, and for our purposes, ultimately produced incorrect results. Using .IsDesktopHeavyDutyAnalysis seemed to align closely with our expectations (although it's possible the results were a fluke).
-
- Posts: 294
- Joined: Mon Jun 20, 2011 5:04 pm
Re: Tablet Detection
Hey Preston, something isn't right. You shouldn't be using isDesktop and IsDesktopHeavyDutyAnalysis at all. In fact, thank you for pointing out, we will make that method private in future releases. That function, does not do what you think it does.
You are only supposed to look at the capabilities that are returned for each device and comment on device info that you think is wrong.
Are you aware of the "is_tablet" capabiltity?
Are there devices that you know to be tablets that are not identified as such by the WURFL API?
We are playing with the idea of introducing is_bot, but there are some reasons why this may not be such a good idea.
Thanks
You are only supposed to look at the capabilities that are returned for each device and comment on device info that you think is wrong.
Are you aware of the "is_tablet" capabiltity?
Are there devices that you know to be tablets that are not identified as such by the WURFL API?
We are playing with the idea of introducing is_bot, but there are some reasons why this may not be such a good idea.
Thanks
-
- Posts: 4
- Joined: Mon Jun 11, 2012 9:54 am
Re: Tablet Detection
I guess I should start by saying that we are not currently using the API for "capability" detection, we are merely trying to analyze our web traffic to view our customer behavior characteristics based on the type of device/browser they are using.
I am aware that these fields are non-deterministic, but for my purposes they are very useful indeed, it would be a shame to have them be removed from the API, if they were to be removed then the product would not be commercially viable for us since this is exactly the type of functionality we are looking for.
I've seen the source code to these methods, and the .IsDesktopHeavyDutyAnalysis(...) is exactly what we are looking for. I am subsequently parsing these boolean "IsXXX" values using a set of business rules to come up with a deterministic result (using trial and error of these rules against a known data-set to reduce error rates). I fully expect there to be some error, and that we are attempting to use this API in a manner that the API was not originally intended, but these methods do currently provide value for my company.
I am currently researching the "is_tablet" capability, mainly attempting to figure out how I need to change my business rules to fit this additional piece of data into those rules.
I am aware that these fields are non-deterministic, but for my purposes they are very useful indeed, it would be a shame to have them be removed from the API, if they were to be removed then the product would not be commercially viable for us since this is exactly the type of functionality we are looking for.
I've seen the source code to these methods, and the .IsDesktopHeavyDutyAnalysis(...) is exactly what we are looking for. I am subsequently parsing these boolean "IsXXX" values using a set of business rules to come up with a deterministic result (using trial and error of these rules against a known data-set to reduce error rates). I fully expect there to be some error, and that we are attempting to use this API in a manner that the API was not originally intended, but these methods do currently provide value for my company.
I am currently researching the "is_tablet" capability, mainly attempting to figure out how I need to change my business rules to fit this additional piece of data into those rules.
-
- Posts: 294
- Joined: Mon Jun 20, 2011 5:04 pm
Re: Tablet Detection
is_tablet *is* a capability, so you are using WURFL for capability detection.
The utility functions you mention are for the API own internal use. You shouldn't use those functions anymore that you would walk into a door that says 'staff only' only because you happen to see that it is not locked. Anyway, those doors will get locked. That's the way it is supposed to be.
Again, the function is not doing what you think it is doing, so your data analysis will be skewed. Please use the API the way it is supposed to be used. What you are doing is not right, let alone is it supported.
Thanks
The utility functions you mention are for the API own internal use. You shouldn't use those functions anymore that you would walk into a door that says 'staff only' only because you happen to see that it is not locked. Anyway, those doors will get locked. That's the way it is supposed to be.
Again, the function is not doing what you think it is doing, so your data analysis will be skewed. Please use the API the way it is supposed to be used. What you are doing is not right, let alone is it supported.
Thanks
Re: Tablet Detection
Hi ,
I used wurfl-2.3.3.zip WURFL File and checked my site with Samsung Galaxy Tab 2 10.1 and it identifies the device as a mobile phone but if I check it with Ipad it correctly identifies it as a tablet.
FYI, the following is the script I used.
$is_tablet = ($requestingDevice->getCapability('is_tablet') == 'true');
$is_phone = ($requestingDevice->getCapability('can_assign_phone_number') == 'true');
if ($is_tablet) {
echo "This is a Tablet";
} else if ($is_phone) {
echo "This is a Mobile Phone";
}
Can you please help me to fix this problem and which make sure WURFL File can identifies all tablets (including samsung) ?
Many thanks,
Ashan
I used wurfl-2.3.3.zip WURFL File and checked my site with Samsung Galaxy Tab 2 10.1 and it identifies the device as a mobile phone but if I check it with Ipad it correctly identifies it as a tablet.
FYI, the following is the script I used.
$is_tablet = ($requestingDevice->getCapability('is_tablet') == 'true');
$is_phone = ($requestingDevice->getCapability('can_assign_phone_number') == 'true');
if ($is_tablet) {
echo "This is a Tablet";
} else if ($is_phone) {
echo "This is a Mobile Phone";
}
Can you please help me to fix this problem and which make sure WURFL File can identifies all tablets (including samsung) ?
Many thanks,
Ashan
Re: Tablet Detection
Hi Ashan,
Can you send me the User Agent for the Galaxy Tab you are using? You can submit it by going here. Also, what's the date on the WURFL.xml file you are using?
Thanks!
Can you send me the User Agent for the Galaxy Tab you are using? You can submit it by going here. Also, what's the date on the WURFL.xml file you are using?
Thanks!
Sriram Sridharan
-
- Posts: 4
- Joined: Fri Jan 11, 2013 1:21 pm
Re: Tablet Detection
Today, I have extensively tested the Samsung Galaxy Tab2 10.1, Samsung Galaxy Note 10.1, Samsung Activ Tab, iPhone5, iPad Mini, iPad Retina & iPad2 using a similar php script with the Cloud WURFL...
I have found that both the Samsung Galaxy Tab2 10.1 & Samsung Galaxy Note 10.1, are confused about their identites. Having tried several of each device, some redirect to 'tablet' & some redirect to 'mobile'. There is no consistency!
The iPad/iPhone devices all behave as they should (...& I'm a PC/Android user)!!
Have the Samsung devices undergone recent upgrades not recorded in the WURFL ...Jelly Bean, perhaps?
Code: Select all
$wireless = ($client->getDeviceCapability('is_wireless_device'));
$tablet = ($client->getDeviceCapability('is_tablet'));
if ($tablet){
echo "This is a tablet device";
} elseif ($wireless && !$tablet) {
echo "This is a mobile device";
}...
The iPad/iPhone devices all behave as they should (...& I'm a PC/Android user)!!
Have the Samsung devices undergone recent upgrades not recorded in the WURFL ...Jelly Bean, perhaps?
Re: Tablet Detection
Hi,
Could you please visit this webpage from the devices that have detection issues? We will look into this and keep you updated.
Thanks!
Could you please visit this webpage from the devices that have detection issues? We will look into this and keep you updated.
Thanks!
Sriram Sridharan
Re: Tablet Detection
Hi,
Hope the Following (attached) links of the Android mobile/Tab header info. (taken after submitting the empty form - https://db.scientiamobile.com/h) will be useful for solving this issue.
Awaiting your reply to continue our mobile project.
Many Thanks,
Ashan
Hope the Following (attached) links of the Android mobile/Tab header info. (taken after submitting the empty form - https://db.scientiamobile.com/h) will be useful for solving this issue.
Awaiting your reply to continue our mobile project.
Many Thanks,
Ashan
-
- Posts: 294
- Joined: Mon Jun 20, 2011 5:04 pm
Re: Tablet Detection
We will look into this and we will likely end in adding the UA strings that you submitted into WURFL, so that they are correctly recognized as "tablet SDK" and "Android SDK" respectively, but please observe that what you submitted are not real devices, so the UA string will be different from the one submitted by the real device.
For the record, here are the UAs we received:
Mozilla/5.0 (Linux; U; Android 2.3.3; en-us; sdk Build/GRI34) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; sdk Build/MR1) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
Thanks
For the record, here are the UAs we received:
Mozilla/5.0 (Linux; U; Android 2.3.3; en-us; sdk Build/GRI34) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; sdk Build/MR1) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
Thanks
Re: Tablet Detection
Hi,
We are interested in your cloud method and going to purchase it once our mobile site development is done. So before purchase, we did some tests (specially for tables, since we are going to maintain tablet version of our site) and for that we used eclipse (http://www.eclipse.org/) which is used for android application development and the tests.
We used a WURFL cloud free account and detected if the device is mobile or tablet with the following code.
if ($client->getDeviceCapability('is_tablet'))
echo "This is a Tablet";
else if ($client->getDeviceCapability('can_assign_phone_number'))
echo "Mobile Phone";
So we found that number of tables are still being identified as mobile. So I thought if I send you the info of UA string, it'll be useful for you to address this issue. Attached is the screen shots of the device info of those which had this issue (collected using https://db.scientiamobile.com/h). Also I understand that this Emulator's user agent string may differ from the actual device but we found the issue when we test on the actual one also (only tested with a few actual devices).
Hope you find this info. to be useful.
Thanks,
Ashan
We are interested in your cloud method and going to purchase it once our mobile site development is done. So before purchase, we did some tests (specially for tables, since we are going to maintain tablet version of our site) and for that we used eclipse (http://www.eclipse.org/) which is used for android application development and the tests.
We used a WURFL cloud free account and detected if the device is mobile or tablet with the following code.
if ($client->getDeviceCapability('is_tablet'))
echo "This is a Tablet";
else if ($client->getDeviceCapability('can_assign_phone_number'))
echo "Mobile Phone";
So we found that number of tables are still being identified as mobile. So I thought if I send you the info of UA string, it'll be useful for you to address this issue. Attached is the screen shots of the device info of those which had this issue (collected using https://db.scientiamobile.com/h). Also I understand that this Emulator's user agent string may differ from the actual device but we found the issue when we test on the actual one also (only tested with a few actual devices).
Hope you find this info. to be useful.
Thanks,
Ashan
- Attachments
-
- 7.0_WSVGA_-_AV_2.3.jpg (123.54 KiB) Viewed 29931 times
-
- 4.7_WXGA_-_AV_4.3.jpg (236.5 KiB) Viewed 29931 times
-
- Device info. screen shots
- 4.7_WXGA_-_AV_2.3.gif (117.27 KiB) Viewed 29931 times
-
- Posts: 294
- Joined: Mon Jun 20, 2011 5:04 pm
Re: Tablet Detection
Ashan, we don't see UAs of any real devices left by you in the headers queue. But we do see a bunch of SDK UAs.
Can you please tell us which UA strings those devices you have tested have?
Also, the Cloud gets refreshed weekly, so it may take 1 to 7 days between when we add a new profile to when the Cloud starts recognizing it.
Thanks
Can you please tell us which UA strings those devices you have tested have?
Also, the Cloud gets refreshed weekly, so it may take 1 to 7 days between when we add a new profile to when the Cloud starts recognizing it.
Thanks
-
- Posts: 294
- Joined: Mon Jun 20, 2011 5:04 pm
Re: Tablet Detection
Adhan, to be clear, those SDK are NOT sending the UA string of the real device. Can you please confirm that you understand this before you raise the same issue again?sm_support2 wrote:Ashan, we don't see UAs of any real devices left by you in the headers queue. But we do see a bunch of SDK UAs.
Can you please tell us which UA strings those devices you have tested have?
Thanks
-
- Posts: 4
- Joined: Fri Jan 11, 2013 1:21 pm
Re: Tablet Detection
The Samsung Galaxy Note 10.1 tablet has several different builds. Your database lists the Samsung GT-N8000 (Galaxy Note 10.1) with UA:
Mozilla/5.0 (Linux; U; Android 4.0; xx-xx; GT-N8000 Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
I have been testing the Samsung GT-8010 (Galaxy Note 10.1) tablet with Android Jelly Bean giving UA:
Mozilla/5.0 (Linux; U; Android 4.1.1; en-gb; GT-N8010 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
Your database returns it as an Unknown Android 4.1 Mobile Phone
Mozilla/5.0 (Linux; U; Android 4.0; xx-xx; GT-N8000 Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
I have been testing the Samsung GT-8010 (Galaxy Note 10.1) tablet with Android Jelly Bean giving UA:
Mozilla/5.0 (Linux; U; Android 4.1.1; en-gb; GT-N8010 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
Your database returns it as an Unknown Android 4.1 Mobile Phone
Re: Tablet Detection
Hi,20pictures wrote:The Samsung Galaxy Note 10.1 tablet has several different builds. Your database lists the Samsung GT-N8000 (Galaxy Note 10.1) with UA:
Mozilla/5.0 (Linux; U; Android 4.0; xx-xx; GT-N8000 Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
I have been testing the Samsung GT-8010 (Galaxy Note 10.1) tablet with Android Jelly Bean giving UA:
Mozilla/5.0 (Linux; U; Android 4.1.1; en-gb; GT-N8010 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
Your database returns it as an Unknown Android 4.1 Mobile Phone
I've added the Jelly Bean UA for GT-N8010 to the WURFL DB. You should see it in this weekend's WURFL.xml snapshot onwards. If you use WURFL Cloud, it should be in the next WURFL device database refresh.
Cheers!
Sriram Sridharan
Re: Tablet Detection
Hi ,sm_support2 wrote:Adhan, to be clear, those SDK are NOT sending the UA string of the real device. Can you please confirm that you understand this before you raise the same issue again?sm_support2 wrote:Ashan, we don't see UAs of any real devices left by you in the headers queue. But we do see a bunch of SDK UAs.
Can you please tell us which UA strings those devices you have tested have?
Thanks
FYI, I understand that the UA (provided in the screenshots) are deffer from the real devices as you mentioned in your reply earlier. I provided you this info assuming that you will be able to get the UAs of the real device corresponding to SDK UAs and keep your DB updated.
Sorry I did not have a way of checking those with the real devices and for any inconvenience caused.
Thanks
Re: Tablet Detection
Hi Ashan,
There is no way to infer the UA or even the model number of an actual device, given a sdk UA; the latter replaces the device identifying information, that an actual device would have sent within the UA, with the value 'sdk'.
The best way to find out if a particular device is being detected or not, is by visiting this website on that device.
Cheers!
There is no way to infer the UA or even the model number of an actual device, given a sdk UA; the latter replaces the device identifying information, that an actual device would have sent within the UA, with the value 'sdk'.
The best way to find out if a particular device is being detected or not, is by visiting this website on that device.
Cheers!
Sriram Sridharan
Who is online
Users browsing this forum: No registered users and 58 guests