Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 430589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:53:24+00:00 2026-05-12T19:53:24+00:00

I’ve implemented Wurfl, but the problem with this is that it’s giving me the

  • 0

I’ve implemented Wurfl, but the problem with this is that it’s giving me the wrong screen resolution for my phones. How accurate is wurfl and I do not know what I’m doing wrong.

require_once 'wurfl_config.php';

require_once WURFL_CLASS_FILE;

$ua = strtolower($_SERVER['HTTP_USER_AGENT']);


$wurflObj = new wurfl_class();
$wurflObj->GetDeviceCapabilitiesFromAgent($ua);

$width = $wurflObj->capabilities['display']['resolution_width'];

//Config file
    // Single define to be checked when starting the parser and/or the class
define("WURFL_CONFIG", true);

// Where all data is stored (wurfl.xml, cache file, logs, etc)
$data = '/var/www/html/includes/wurfl/';
define("DATADIR", $data);

// Path and filename of wurfl_parser.php
define("WURFL_PARSER_FILE", 'wurfl_parser.php');

// Path and filename of wurfl_class.php
define("WURFL_CLASS_FILE", 'wurfl_class.php');

// Path and name of the wurfl
define ("WURFL_FILE", DATADIR."wurfl.xml");

// Path and name of the log file
define ("WURFL_LOG_FILE", DATADIR."wurfl.log");

// suggested log level for normal use (default PHP logging constants)
//define ("LOG_LEVEL", LOG_ERROR );
// suggested log level for debug use
define ("LOG_LEVEL", LOG_INFO);

// Set this true if you want to use cache. Strongly suggested
define ("WURFL_USE_CACHE", true);

// Set this true if you want to avoid using cache.php file, and
// generate a single file for each device user agent and use that as a cache
// NOTICE: using Multicache will still generate cache.php and agent2id.php,
//  but will not dump the entire XML as PHP into cache.php. As a result
//  cache.php will be MUCH smaller and load WAY faster; as a drawback you will
//  have many more I/O accesses to the single tiny files.
define ("WURFL_USE_MULTICACHE", true);

// Path and name of the cache file
define ("CACHE_FILE", DATADIR."cache.php");

// Set path of the Multicache directory where all the little caches will be
// stored. Should be a directory that contains *only* these files, so that its
// content can be safely cleaned when a new cache is created.
// If not using Multicache, this parameter will not be used.
define ("MULTICACHE_DIR", DATADIR."multicache/");

// Temporary directory for manual updates.
define ("MULTICACHE_TMP_DIR", DATADIR."multicache_tmp/");
// This file is created and removed when manually updating multicache files
define ("MULTICACHE_TOUCH", DATADIR."multicache.lockfile");

// File suffix for Multicache files
define ("MULTICACHE_SUFFIX",".php");

// Autoload set to false, I will load it when needed
define ("WURFL_AUTOLOAD", false);

// This parameter tells the class to automatically update cache files when a
// new XML is found.
// Using the multicache is not suggested to automatically update it. Use the
// external scripts.
define ("WURFL_CACHE_AUTOUPDATE", true);

// Path and name of the file to store user_agent->id relation
// (ignored if caching is disabled)
define ("WURFL_AGENT2ID_FILE", DATADIR."agent2id.php4");

// Configure a patch file
define("WURFL_PATCH_FILE", DATADIR.'wurfl_patch.xml');
define("WURFL_PATCH_DEBUG", false);

//define("WURFL_PATCH_FILE", DATADIR.'web_browsers_patch.xml');

// Set the maximum number of user_agents to cache
define ("MAX_UA_CACHE", 30);

Is this a known issue that the incorrect width is being returned, or do I do something wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T19:53:25+00:00Added an answer on May 12, 2026 at 7:53 pm

    WURFL is as accurate as the data in it. Generally it is very good though.

    Which version of the WURFL data are you using?
    What device and browser are you trying to get the screen dimensions for? (What is the user agent?)
    What value(s) are you getting?
    What value(s) were you expecting?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6
I have a bunch of posts stored in text files formatted in yaml/textile (from
We're building an app, our first using Rails 3, and we're having to build
I am trying to loop through a bunch of documents I have to put
I'm making a simple page using Google Maps API 3. My first. One marker

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.