I've been using WURFL OnSite for Java, and have been having troubles extracting certain capabilities. According to the WURFL capabilities page (https://www.scientiamobile.com/wurflCapability), there should be a "mobile_browser" capability field which returns information about the device browser. However when I try extracting the "mobile_browser" capability, I get a capability not defined exception. Below is the code and error.
Code: Select all
package wurfl;
import com.scientiamobile.wurfl.core.Device;
import com.scientiamobile.wurfl.core.EngineTarget;
import com.scientiamobile.wurfl.core.GeneralWURFLEngine;
public class wurfl {
public static void main(String[] args) {
GeneralWURFLEngine wurfl = new GeneralWURFLEngine(
"/Users/shenjin/Downloads/onsite_evaluation_1.8.0.0_Java_API/release-eval/core/release/wurfl.xml");
wurfl.setEngineTarget(EngineTarget.accuracy);
String user_agent = "Mozilla/5.0 (Linux; Android 4.2.1; N9600 Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36";
Device device = wurfl.getDeviceForRequest(user_agent);
System.out.println("Is Tablet: " + device.getCapability("is_tablet"));
System.out.println("Can Assign Phone Number: "
+ device.getCapability("can_assign_phone_number"));
System.out.println("Mobile Browser: "
+ device.getCapability("mobile_browser"));
}
}
Is this something that's just not supported in the latest WURFL OnSite Java client? I noticed that there are a lot fewer capabilities than the 500+ advertised on the site.Exception in thread "main" com.scientiamobile.wurfl.core.exc.CapabilityNotDefinedException: Capability: mobile_browser - Capability: mobile_browser is not defined in WURFL
at com.scientiamobile.wurfl.core.i.a(Unknown Source)
at com.scientiamobile.wurfl.core.m.getCapability(Unknown Source)
at com.scientiamobile.wurfl.core.DefaultDevice.getCapability(Unknown Source)
at wurfl.wurfl.main(wurfl.java:22)
Code: Select all
////wurfl.getAllCapabilities();
[mobile_browser_version,
resolution_height,
resolution_width,
is_wireless_device,
is_tablet,
preferred_markup,
brand_name,
can_assign_phone_number,
xhtml_support_level,
ux_full_desktop,
device_os,
is_smarttv,
model_name,
marketing_name,
device_os_version,
pointing_method]
//wurfl.getAllVirtualCapabilities();
[is_app,
is_app_webview,
is_mobile,
is_phone,
is_full_desktop,
advertised_browser,
is_smartphone,
is_robot,
complete_device_name,
is_largescreen,
advertised_device_os,
is_android,
is_xhtmlmp_preferred,
device_name,
is_html_preferred,
advertised_browser_version,
is_windows_phone,
is_ios,
is_touchscreen,
is_wml_preferred,
form_factor,
advertised_device_os_version]
Thanks!