Attempting to upgrade the API to 1.6 I am getting the is_smartphone capabilty in not defined in WURFL.
Is there updated documentation that states what the latest capabilities are?
Version 1.6 capabilities
Re: Version 1.6 capabilities
Hello,
A full list of our capabilities can be found here. The `is_smartphone` virtual capability has not been removed in 1.6. Are you able to provide a code sample to demonstrate how you are using the capability?
Thank you,
Elliot
A full list of our capabilities can be found here. The `is_smartphone` virtual capability has not been removed in 1.6. Are you able to provide a code sample to demonstrate how you are using the capability?
Thank you,
Elliot
-
- Posts: 3
- Joined: Fri Apr 17, 2015 2:56 pm
Re: Version 1.6 capabilities
Code: Select all
private String userAgent;
private Device device;
public DeviceInfo(String userAgent, Device device) {
this.userAgent = userAgent;
this.device = device;
this.initializeCapabilities();
}
/**
* Initialize all capabilities from the Device
*/
private void initializeCapabilities() {
this.setDeviceTypeCapabilities();
this.setDeviceOSCapabilities();
this.setDeviceBrowserCapabilities();
this.setDeviceDisplayCapabilities();
}
/**
* Initialize device type capabilities
*/
private void setDeviceTypeCapabilities() {
desktop = device.getCapabilityAsBool("ux_full_desktop");
mobile = device.getCapabilityAsBool("is_wireless_device");
formFactor = device.getCapability("form_factor");
[b]smartPhone = device.getCapabilityAsBool("is_smartphone");[/b]
tablet = device.getCapabilityAsBool("is_tablet");
smartTV = device.getCapabilityAsBool("is_smarttv");
console = device.getCapabilityAsBool("is_console");
crawler = device.getCapabilityAsBool("is_robot");
googleGlass = device.getCapabilityAsBool("is_google_glass");
}
here is an example of another one:
net.sourceforge.wurfl.core.exc.CapabilityNotDefinedException: Capability: is_ios - Capability: is_ios is not defined in WURFL
at net.sourceforge.wurfl.core.DefaultCapabilitiesHolder.getCapabilityValue(DefaultCapabilitiesHolder.java:87)
at net.sourceforge.wurfl.core.AbstractCapabilitiesHolder.getCapabilityValueAsBool(AbstractCapabilitiesHolder.java:29)
at net.sourceforge.wurfl.core.DefaultInternalDevice.getCapabilityAsBool(DefaultInternalDevice.java:105)
at net.sourceforge.wurfl.core.DefaultDevice.getCapabilityAsBool(DefaultDevice.java:185)
Re: Version 1.6 capabilities
Keep in mind that several of these capabilities are virtual capabilities and therefore you would want to use the `getVirtualCapabilityAsBool` method instead. Looking through the capabilities that you are using in your sample, you will want to update `is_robot`, `is_smartphone`, `form_factor`, and `is_ios` to use `getVirtualCapabilityAsBool`.
Thank you,
Elliot
Thank you,
Elliot
-
- Posts: 3
- Joined: Fri Apr 17, 2015 2:56 pm
Re: Version 1.6 capabilities
Adding Virtual to my function calls solved my issue.
Who is online
Users browsing this forum: No registered users and 6 guests