wurfl很实用,手机型号比较全,省去自己去收集各种信息了。。。
读取使用API有很多种方式,show下偶的吧..
ListManager listManager = ObjectsManager.getListManagerInstance();
TreeMap map = listManager.getDeviceGroupedByBrand();
if (map != null) {
Set set = map.keySet();
//厂商名称
String brandName = "";
//手机型号
String modelName = "";
int load_company_num = 0;
int load_phone_num = 0;
for (Iterator iterator = set.iterator(); iterator.hasNext();) {
Object brandName_obj = iterator.next();
brandName = brandName_obj.toString();
load_company_num ++;
Object phoneMap_obj = map.get(brandName_obj);
if (phoneMap_obj instanceof TreeMap) {
TreeMap phoneMap = (TreeMap) phoneMap_obj;
Set phoneSet = phoneMap.keySet();
l
for (Iterator iterator1 = phoneSet.iterator(); iterator1.hasNext();) {
Object modelName_obj = iterator1.next();
modelName = modelName_obj.toString();
Object device_obj = phoneMap.get(modelName_obj);
if (device_obj instanceof WurflDevice) {
WurflDevice device = (WurflDevice) device_obj;
String agent_id = device.getId();
CapabilityMatrix cm = ObjectsManager.getCapabilityMatrixInstance();
//分辨率 宽
String w = cm.getCapabilityForDevice(agent_id, "resolution_width");
//分辨率 高
String h = cm.getCapabilityForDevice(agent_id, "resolution_height");
//操作系统
String os = cm.getCapabilityForDevice(agent_id, "device_os");
//os 版本
String os_ver = cm.getCapabilityForDevice(agent_id, "device_os_version");
load_phone_num ++;
System.out.println("brandName = " + brandName);
System.out.println("modelName = " + modelName );
System.out.println("w= " + w);
System.out.println("h= " + h);
System.out.println("os= " + os);
System.out.println("os_ver= " + os_ver);
}
}
}
}
System.out.println("map.size() = " + map.size());
System.out.println("load_company_num = " + load_company_num);
System.out.println("load_phone_num = " + load_phone_num);
}
其中 cm.getCapabilityForDevice 能获得参数,参考
http://wurfl.sourceforge.net/help_doc.php
wurfl.xml里面有1万多手机型号....
对于如何配置,官网说的比较清楚.
分享到:
相关推荐
WURFL is a set of proprietary application programming interfaces (APIs) and an XML configuration file which contains information about device capabilities and features for a variety of mobile devices...
详细的浏览器版本检测,功能库强大,api易懂。wurfl,浏览器版本检测的不二选择
详细的浏览器版本检测,功能库强大,api易懂。wurfl,浏览器版本检测的不二选择
2016-05-23 由官方scientiamobile更新的php api
com.scientiamobile wurfl-core 1.8.0.0 浏览器检测 jar包
所有移动终端类型都在这个官方的文件中了,了解最新动态,请电邮联系
NULL 博文链接:https://crazysky.iteye.com/blog/1179069
工具(C)将WURFL XML移动浏览器数据库拆分为带有符号链接(NTFS存根)的单个设备文件,以减少访问时间和服务器负载。 包括一个简单PHP库/ API作为如何访问数据的示例,以及一个示例phtml文件。
Tera-WURFL可以使用PHP,MySQL数据库后端和标准化的无线通用资源文件(WURFL)来识别移动设备的功能。
用于.NET(C#)的WURFL API。 该API设计专注于WURFL的发展,包括用于数据访问抽象层的模块和用于UAgent进行启发式搜索的模块。
关于手机型号和类型的wurfl数据
Dinfo 是一个独立的 Java servlet,带有可用的 WAR 包,用于提供对 WURFL 信息的访问。
用于OpenDDR和WURFL的Java API的读取,写入和重构操作。
很快,人们会更愿意在手机和平板电脑而不是PC机上浏览网页。你的企业需要一种移动策略,不过从哪里开始呢?本书会告诉你如何使用你熟悉的Web技术建立网站和应用,可以在各种任意大小的设备上工 作。把你的HTML、...
终端适配配置 wurfl 配置文件 其中包含很多设备的配置
SMIL, Voxeo's Prophecy server, VoiceXML (VXML), grXML, Frost library, WALL, WURFL, SMS, MMS, mobile payment gateways, mobile widgets, Mobile AJAX, Android, Google Gears, and Dojo Offline. What you ...
Use the latest development techniques—including Responsive Web Design and server-side device detection with WURFL Learn quickly through images, puzzles, stories, and quizzes We think your time is too...
服务器应用程序是针对“移动”客户端优化的一组服务器应用程序。 这些应用程序基于XAMP,共享一个通用框架并提供手机定义(基于WURFL)。 相同的应用程序是:移动门户,移动图片库,...
Java Swing GUI,用于查看,搜索和编辑WURFL移动设备信息。