开发者

Mobile Handset detection Using Tera-WURFL

开发者 https://www.devze.com 2023-01-10 03:42 出处:网络
I develop a wap portal for games. My problem is to detecthandset device perfectly. My games provider provide me the supported handset list like this:

I develop a wap portal for games. My problem is to detect handset device perfectly. My games provider provide me the supported handset list like this:

Nokia6300, SGH-X200, MOT-C261, SIE-CX70, SAMSUNG-SGH-Z140

So, I have to detect the supported games for the particular wap user.

I can easily detect the handset for nokia devices using below command:

require_once('../TeraWurfl.php'); 
$wurflObj = new TeraWurfl();
$matched = $wurflObj->getDeviceCapabilitiesFromAgent();
$brand_name = $wurflObj->getDeviceCapability("brand_name");
$model_na开发者_JAVA技巧me = $wurflObj->getDeviceCapability("model_name");
$handset=$brand_name. $model_name;

//Nokia6300,Nokia6600 etc.

But the problem is for siemence ,Motorola ,some Samsung sets,and lot of others. Let say the user agent:

SIE-CX70/36 UP.Browser/7.0.2.2.156(GUI) MMP/2.0 Profile/MIDP-2.0 Configuration/CLDC-1.1

Provide me the model name: CX70 and Brand Name: Siemens. So if I concatenate then get the value: SiemensCX70.But the actual is: SIE-CX70. So, Information mis-match.

Now my question is how can I detection the perfect handset. Please help me to retrieve the actual info.

Thanks riad


I guess you have already figured this out, there is no easy way to do this, you will need to maintain a mapping on your side that maps the WURFLMODELNAME to the actual handset that your client gives. This way you can have a better Display of the handset names. Make sure you can do a many to one mapping so that you can map 1 or many WURFL Model Names to 1 Handset Display name.


You could utilize UAProf, a URL of RDF format which describes handset capabilities, together with the user agent because UAProf does not always exist in the header. I won't say it's perfect because there is always some exception. I have seen a RDF file which has invalid format. But it might be helpful for your case.

Please refer to this simple example (Restlet):

http://shengchien.blogspot.com/2010/09/restful-mobile-detection.html

0

精彩评论

暂无评论...
验证码 换一张
取 消