0

I have downloaded both wurfl api and mobiledetect.net and testing it with my Samsung Galaxy S3 (GT-19300).

I am very surprised that this smartphone is not detected with none of these script... There must be something wrong...

The script (http://www.gondwanastudio.com/xJava/WURFL/examples/demo/index.php) returns the following UA for the Galaxy S3... (User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.34 Safari/534.24) and tells that " This is a Desktop Web Browser".

I have the same problem with the script (http://www.gondwanastudio.com/xJava/test.php) from mobiledetect.net.

include_once './inc/wurfl_config_standard.php';

$wurflInfo = $wurflManager->getWURFLInfo();

$requestingDevice = $wurflManager->getDeviceForUserAgent($_GET['ua']);

if ($requestingDevice->getCapability('is_tablet') == 'true') {
   echo "Tablet";
}

$is_wireless = ($requestingDevice->getCapability('is_wireless_device') == 'true');
$is_smarttv = ($requestingDevice->getCapability('is_smarttv') == 'true');
$is_tablet = ($requestingDevice->getCapability('is_tablet') == 'true');
$is_phone = ($requestingDevice->getCapability('can_assign_phone_number') == 'true');

if (!$is_wireless) {
 if ($is_smarttv) {
  echo "This is a Smart TV";
 } else {
  echo "This is a Desktop Web Browser";
 }
} else {
 if ($is_tablet) {
  echo "This is a Tablet";
 } else if ($is_phone) {
  echo "This is a Mobile Phone";
 } else {
  echo "This is a Mobile Device";
 }
}
Paul Godard
  • 1,055
  • 1
  • 14
  • 30

1 Answers1

0

I think the issue is with your UA. Are you by chance using your phone in desktop mode? Right now it looks like it is identifying itself as desktop and not as mobile, which explains why it is not being detected. Your user agent should look more along the lines of:

Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; GT-I9300 Build/IMM76K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30

If you check using the WURFL tool on the ScientiaMobile site (http://tools.scientiamobile.com) , it should pull up as a Galaxy S3.