Main Page
From Tera-WURFL
(→ANOUNCEMENTS) |
|||
(30 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
<seo title="- Mobile Device Identification" metakeywords="wurfl, wurlf, wurfl mysql, tera technologies, tera-wurfl, tera wurfl, mobile device capabilities, redirect mobile, wap, wml, steve kamerman, wurfl database, device database, open source, device images, cell phone images, mobile images" metadescription="Tera-WURFL detects mobile device capabilities (cell phones, PDAs, BlackBerrys, iPhones). These capabilities include everything from ringtone formats to screen size to java/j2me support. Based on the WURFL project, Tera-WURFL uses PHP and MySQL to provide an extremely high performance database-driven WURFL solution. Current releases include support for xml web services, caching, patching, guided installation, sanity checking and one-thouch updates from the WURFL site. Great for redirecting mobile visitors, determining streaming video capabilities and detecting supported ringtone formats." /> | <seo title="- Mobile Device Identification" metakeywords="wurfl, wurlf, wurfl mysql, tera technologies, tera-wurfl, tera wurfl, mobile device capabilities, redirect mobile, wap, wml, steve kamerman, wurfl database, device database, open source, device images, cell phone images, mobile images" metadescription="Tera-WURFL detects mobile device capabilities (cell phones, PDAs, BlackBerrys, iPhones). These capabilities include everything from ringtone formats to screen size to java/j2me support. Based on the WURFL project, Tera-WURFL uses PHP and MySQL to provide an extremely high performance database-driven WURFL solution. Current releases include support for xml web services, caching, patching, guided installation, sanity checking and one-thouch updates from the WURFL site. Great for redirecting mobile visitors, determining streaming video capabilities and detecting supported ringtone formats." /> | ||
<center>[[File:headerlogo.png]]</center> | <center>[[File:headerlogo.png]]</center> | ||
- | __TOC__ [[File:TeraWurflExplorerSmall.png|frame|right|The improved | + | __TOC__ [[File:TeraWurflExplorerSmall.png|frame|right|The improved ScientiaMobile Explorer at http://www.tera-wurfl.com/explore/]] |
__FORCETOC__ | __FORCETOC__ | ||
- | == | + | ==BIG NEWS - Tera-WURFL is now part of the ScientiaMobile API Lineup== |
- | + | [http://www.scientiamobile.com ScientiaMobile] is a joint venture between the WURFL Project and the Tera-WURFL project. Tera-WURFL will still be free and open source, but now we're offering full commercial support, additional features and more accurate data! | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | Check out the [http://bit.ly/kp6O0V ScientiaMobile Press Release] for more details! | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ==Current Version: [[Downloads#Current_Version|Tera-WURFL 2.1.5]]== | |
- | + | * Improved CLI Admin (admin/cmd_line_admin.php) | |
- | * | + | * Improved Error Handling |
- | * | + | * Added cURL support to Remote Client |
- | * | + | * Improved installation script |
+ | * Fixed XML Loader Segfault bug with xdebug | ||
+ | * Fixed IE9/10 bug | ||
+ | * Updated matchers: SimpleDesktop, Android, BlackBerry, Opera, Apple | ||
- | == What is Tera-WURFL == | + | == What is the WURFL Database API (Tera-WURFL) == |
- | + | The WURFL Database API is a PHP & MySQL/MSSQL/MongoDB based library by [http://www.scientiamobile.com/ ScientiaMobile] that uses the Wireless Universal Resource File (WURFL) to detect the capabilities of mobile devices. The [http://wurfl.sourceforge.net WURFL website] nicely defines the WURFL as follows: | |
<blockquote style="background-color: rgb(255, 225, 227); border: 2px solid rgb(255, 202, 206); margin: 5px; padding: 5px; width: 500px;"> | <blockquote style="background-color: rgb(255, 225, 227); border: 2px solid rgb(255, 202, 206); margin: 5px; padding: 5px; width: 500px;"> | ||
The WURFL is an "ambitious" configuration file that contains info about all known Wireless devices on earth. Of course, new devices are created and released at all times. While this configuration file is bound to be out of date one day after each update, chances are that the WURFL lists all of the WAP devices you can purchase in the nearest shops. | The WURFL is an "ambitious" configuration file that contains info about all known Wireless devices on earth. Of course, new devices are created and released at all times. While this configuration file is bound to be out of date one day after each update, chances are that the WURFL lists all of the WAP devices you can purchase in the nearest shops. | ||
</blockquote> | </blockquote> | ||
- | Example applications of | + | Example applications of the WURFL DBAPI include: |
* Redirecting mobile visitors to the mobile version of your site | * Redirecting mobile visitors to the mobile version of your site | ||
* Detecting the type of streaming video that a visiting mobile device supports | * Detecting the type of streaming video that a visiting mobile device supports | ||
* Detecting iPhone, iPod and iPad visitors and delivering them an iPhone-friendly version of your site | * Detecting iPhone, iPod and iPad visitors and delivering them an iPhone-friendly version of your site | ||
- | |||
* Detecting ringtone download support and supported ringtone formats | * Detecting ringtone download support and supported ringtone formats | ||
* Detecting the screen resolution of the device and resizing images and wallpapers/backgrounds to an appropriate size for the device. | * Detecting the screen resolution of the device and resizing images and wallpapers/backgrounds to an appropriate size for the device. | ||
* Detecting support for Javascript, Java/J2ME and Flash Lite | * Detecting support for Javascript, Java/J2ME and Flash Lite | ||
- | + | The author of Tera-WURFL is [http://www.stevekamerman.com Steve Kamerman], a professional PHP Programmer, MySQL DBA, Flash/Flex Actionscript Developer, Linux Administrator and full time IT Innovator. This project is one of the Official WURFL APIs from ScientiaMobile, and is offered under Free and Open-Source (FOSS) and Commercial licenses. [http://www.scientiamobile.com/license Licenses and professional support may be obtained directly from ScientiaMobile]. | |
- | + | ||
- | The author of Tera-WURFL is [http://www. | + | |
- | + | ||
- | + | ||
- | + | ||
===Tera-WURFL Project Priorities=== | ===Tera-WURFL Project Priorities=== | ||
- | # '''High Performance''': Tera-WURFL uses a | + | # '''High Performance''': Tera-WURFL uses a database backend (MySQL4 MySQL5, MSSQL, MongoDB) to store the WURFL data and cache the results of device detections. This database can be shared between many installations of Tera-WURFL, so all your sites can benefit from sharing the same cache. Non-cached lookups on my test system average about 250 devices per second, with cached detections over 1000 per second. |
- | # '''Accurate Detection of Mobile Devices''': | + | # '''Accurate Detection of Mobile Devices''': Uses over a dozen UserAgentMatchers, specifically tailored to their own group of mobile devices to provide unmatched detection accuracy. |
# '''Fast Detection of Desktop vs. Mobile Devices''': Although detection of mobile devices is good among most of the libraries, they are not very good at desktop browsers. As a result, your desktop users are detected as mobile devices and sent to the wrong site. Tera-WURFL includes a feature called the '''SimpleDesktop Matching Engine''' that is used to differentiate between desktop and mobile browsers at an extremely high rate. Additionally, instead of the tens of thousands of unique desktop user agents piling up in your cache, SimpleDesktop uses just one entry in the cache to represent all the desktop browsers. | # '''Fast Detection of Desktop vs. Mobile Devices''': Although detection of mobile devices is good among most of the libraries, they are not very good at desktop browsers. As a result, your desktop users are detected as mobile devices and sent to the wrong site. Tera-WURFL includes a feature called the '''SimpleDesktop Matching Engine''' that is used to differentiate between desktop and mobile browsers at an extremely high rate. Additionally, instead of the tens of thousands of unique desktop user agents piling up in your cache, SimpleDesktop uses just one entry in the cache to represent all the desktop browsers. | ||
# '''Usability''': Since PHP has such a large base in the small- to medium-sized website arena, there are a large number of new developers. Tera-WURFL has been designed to be easy to use and administer. Once the initial configuration is finished, you can maintain the system completely from its [[Web Administration Page]], including the ability to update the WURFL data via the Internet. | # '''Usability''': Since PHP has such a large base in the small- to medium-sized website arena, there are a large number of new developers. Tera-WURFL has been designed to be easy to use and administer. Once the initial configuration is finished, you can maintain the system completely from its [[Web Administration Page]], including the ability to update the WURFL data via the Internet. | ||
Line 71: | Line 56: | ||
==Requirements== | ==Requirements== | ||
- | * Hardware: | + | * Hardware: Hardware Independent |
* Software | * Software | ||
- | ** Web Server: Any webserver that supports PHP and the | + | ** Web Server: Any webserver that supports PHP and the appropriate database extension, here are some I've tested: |
*** Apache 2.x | *** Apache 2.x | ||
- | *** IIS 6/7 (for Windows users I recommend [http://www.wampserver.com/en/ WampServer] or [http://www.apachefriends.org/en/xampp-windows.html XAMPP] | + | *** IIS 6/7 (for Windows users I recommend [http://www.wampserver.com/en/ WampServer] or [http://www.apachefriends.org/en/xampp-windows.html XAMPP] instead of IIS) |
*** lighttpd | *** lighttpd | ||
** PHP | ** PHP | ||
*** PHP 5.x with the following required modules: | *** PHP 5.x with the following required modules: | ||
- | + | **** ZipArchive (this package is included with PHP >= 5.2.0. For previous versions of PHP it is [http://pecl.php.net/package/zip available from PECL]). | |
- | **** ZipArchive (this package is included with PHP >= 5.2.0. For previous versions of PHP it is [http://pecl.php.net/package/zip available from PECL]. | + | |
** Database: One of the following database servers: | ** Database: One of the following database servers: | ||
- | *** MySQL >= 4.1 | + | *** MySQL >= 4.1 (uses the [http://us.php.net/manual/en/book.mysqli.php MySQL Improved (MySQLi) extension]) |
- | *** MySQL 5.x | + | *** MySQL 5.x (uses the [http://us.php.net/manual/en/book.mysqli.php MySQL Improved (MySQLi) extension]) |
- | *** Microsoft SQL Server 2005/2008 ( | + | *** Microsoft SQL Server 2005/2008 (uses the [http://msdn.microsoft.com/en-us/sqlserver/cc299381.aspx Microsoft SQL Server Driver for PHP] |
+ | *** MongoDB (uses the [http://us.php.net/mongo MongoDB Native driver]) | ||
==How does it work?== | ==How does it work?== | ||
Line 143: | Line 128: | ||
} | } | ||
?></geshi> | ?></geshi> | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
== Downloads, Installation, Support == | == Downloads, Installation, Support == |
Latest revision as of 13:34, 19 July 2011
![Headerlogo.png](/wiki/images/7/74/Headerlogo.png)
Contents |
![](/wiki/images/3/33/TeraWurflExplorerSmall.png)
BIG NEWS - Tera-WURFL is now part of the ScientiaMobile API Lineup
ScientiaMobile is a joint venture between the WURFL Project and the Tera-WURFL project. Tera-WURFL will still be free and open source, but now we're offering full commercial support, additional features and more accurate data!
Check out the ScientiaMobile Press Release for more details!
Current Version: Tera-WURFL 2.1.5
- Improved CLI Admin (admin/cmd_line_admin.php)
- Improved Error Handling
- Added cURL support to Remote Client
- Improved installation script
- Fixed XML Loader Segfault bug with xdebug
- Fixed IE9/10 bug
- Updated matchers: SimpleDesktop, Android, BlackBerry, Opera, Apple
What is the WURFL Database API (Tera-WURFL)
The WURFL Database API is a PHP & MySQL/MSSQL/MongoDB based library by ScientiaMobile that uses the Wireless Universal Resource File (WURFL) to detect the capabilities of mobile devices. The WURFL website nicely defines the WURFL as follows:
The WURFL is an "ambitious" configuration file that contains info about all known Wireless devices on earth. Of course, new devices are created and released at all times. While this configuration file is bound to be out of date one day after each update, chances are that the WURFL lists all of the WAP devices you can purchase in the nearest shops.
Example applications of the WURFL DBAPI include:
- Redirecting mobile visitors to the mobile version of your site
- Detecting the type of streaming video that a visiting mobile device supports
- Detecting iPhone, iPod and iPad visitors and delivering them an iPhone-friendly version of your site
- Detecting ringtone download support and supported ringtone formats
- Detecting the screen resolution of the device and resizing images and wallpapers/backgrounds to an appropriate size for the device.
- Detecting support for Javascript, Java/J2ME and Flash Lite
The author of Tera-WURFL is Steve Kamerman, a professional PHP Programmer, MySQL DBA, Flash/Flex Actionscript Developer, Linux Administrator and full time IT Innovator. This project is one of the Official WURFL APIs from ScientiaMobile, and is offered under Free and Open-Source (FOSS) and Commercial licenses. Licenses and professional support may be obtained directly from ScientiaMobile.
Tera-WURFL Project Priorities
- High Performance: Tera-WURFL uses a database backend (MySQL4 MySQL5, MSSQL, MongoDB) to store the WURFL data and cache the results of device detections. This database can be shared between many installations of Tera-WURFL, so all your sites can benefit from sharing the same cache. Non-cached lookups on my test system average about 250 devices per second, with cached detections over 1000 per second.
- Accurate Detection of Mobile Devices: Uses over a dozen UserAgentMatchers, specifically tailored to their own group of mobile devices to provide unmatched detection accuracy.
- Fast Detection of Desktop vs. Mobile Devices: Although detection of mobile devices is good among most of the libraries, they are not very good at desktop browsers. As a result, your desktop users are detected as mobile devices and sent to the wrong site. Tera-WURFL includes a feature called the SimpleDesktop Matching Engine that is used to differentiate between desktop and mobile browsers at an extremely high rate. Additionally, instead of the tens of thousands of unique desktop user agents piling up in your cache, SimpleDesktop uses just one entry in the cache to represent all the desktop browsers.
- Usability: Since PHP has such a large base in the small- to medium-sized website arena, there are a large number of new developers. Tera-WURFL has been designed to be easy to use and administer. Once the initial configuration is finished, you can maintain the system completely from its Web Administration Page, including the ability to update the WURFL data via the Internet.
Constant Performance and Accuracy Improvements
Using our in-house analysis and regression testing software built for Tera-WURFL, we are able to quickly perform a deep analysis on the performance and accuracy of both the UserAgentMatchers and the core. This data is then evaluated to identify potential bottlenecks in the system. We are also able to track the internal match confidence that Tera-WURFL has with each device detection and construct aggregate visualizations to determine if there are more new user agents on the Internet that are slipping by the detection system.
Requirements
- Hardware: Hardware Independent
- Software
- Web Server: Any webserver that supports PHP and the appropriate database extension, here are some I've tested:
- Apache 2.x
- IIS 6/7 (for Windows users I recommend WampServer or XAMPP instead of IIS)
- lighttpd
- PHP
- PHP 5.x with the following required modules:
- ZipArchive (this package is included with PHP >= 5.2.0. For previous versions of PHP it is available from PECL).
- PHP 5.x with the following required modules:
- Database: One of the following database servers:
- MySQL >= 4.1 (uses the MySQL Improved (MySQLi) extension)
- MySQL 5.x (uses the MySQL Improved (MySQLi) extension)
- Microsoft SQL Server 2005/2008 (uses the Microsoft SQL Server Driver for PHP
- MongoDB (uses the MongoDB Native driver)
- Web Server: Any webserver that supports PHP and the appropriate database extension, here are some I've tested:
How does it work?
When a web browser (mobile or non-mobile) visits your site, it sends a User Agent along with the request for your page. The user agent contains information about the type of device and browser that is being used; unfortunately, this information is very limited and often times is not representative of the actual device. The WURFL Project collects these user agents and puts them into an XML file, commonly referred to as the WURFL File. This file also contains detailed information about each device i.e. the screen resolution, audio playback capabilities, streaming video capabilities, J2ME support and so on. This data is constantly updated by WURFL contributors from around the world via the WURFL Device Database. Tera-WURFL takes the data from this WURFL file and puts it into a MySQL database (MSSQL support is experimental) for faster access, and determines which device is the most similar to the one that's requesting your content. The library the returns the capabilities associated with that device to your scripts via a PHP Associative Array. Currently, the WURFL contains 29 groups of capabilities with a total of 531 capabilities.
Here's the logical flow of a typical request:
Device Requests a Page
Someone requests one of your pages from their mobile device. Their User Agent is passed to the Tera-WURFL library for evaluation.
Request is Evaluated
Tera-WURFL takes the requestor's user agent and puts it through a filter to determine which UserAgentMatcher to use on it. Each UserAgentMatcher is specifically designed to best match the device from a group of similar devices using Reduction in String and/or the Levenshtein Distance algorithm.
Capabilities Array is Built
Each device in the WURFL file and WURFL database falls back onto another device, for example the iPhone 3GS has only a handful of capabilities, then it falls back onto the iPhone 3G, which adds to those capabilities and falls back onto the original iPhone, then onto a generic device that contains the default capabilities. Through this method of inheritance, the device entries remain very small in size. In our example, once the User Agent has been matched, the capabilities from this device are stored into the capabilities array, then the next device in its fallback tree (its parent device) is looked up, and its capabilities are add, all the way up to the most generic device.
Results are Cached
The capabilities array is now cached with the User Agent so the next time the device visits the site it will be detected extremely quickly.
Capabilities are Available to the Server
The process is finished and the capabilities are now available for use in your scripts. One common use, for example, is to redirect mobile devices to a mobile version of the site:
<?php require_once './TeraWurfl.php'; $wurflObj = new TeraWurfl(); $wurflObj->getDeviceCapabilitiesFromAgent(); // see if this client is on a wireless device if($wurflObj->getDeviceCapability("is_wireless_device")){ header("Location: http://yourwebsite.mobi/"); } ?>
Show a Picture of the Device (optional)
If you have version 2.1.2 or higher, you can show an image of the device (assuming one is available). See the Device Image page for the details.
Here's a usage example:
<?php require_once 'TeraWurfl.php'; require_once 'TeraWurflUtils/TeraWurflDeviceImage.php'; $wurflObj = new TeraWurfl(); $wurflObj->getDeviceCapabilitiesFromAgent(); $image = new TeraWurflDeviceImage($wurflObj); /** * The location of the device images as they are accessed on the Internet * (ex. '/device_pix/', 'http://www.mydomain.com/pictures/') * The filename of the image will be appended to this base URL */ $image->setBaseURL('/device_pix/'); /** * The location of the device images on the local filesystem */ $image->setImagesDirectory('/var/www/device_pix/'); /** * Get the source URL of the image (ex. '/device_pix/blackberry8310_ver1.gif') */ $image_src = $image->getImage(); if($image_src){ // If and image exists, show it $image_html = sprintf('<img src="%s" border="0"/>',$image_src); echo $image_html; }else{ // If an image is not available, show a message echo "No image available"; } ?>
Downloads, Installation, Support
The following pages will guide you through downloading, installing, configuring and extending Tera-WURFL: