Page 1 of 1
Version 1.6 capabilities
Posted: Fri Apr 17, 2015 2:58 pm
by denniskirk
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?
Re: Version 1.6 capabilities
Posted: Fri Apr 17, 2015 3:51 pm
by Elliotfehr
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
Re: Version 1.6 capabilities
Posted: Fri Apr 17, 2015 4:10 pm
by denniskirk
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");
}
the smartPhone = device.getCapabilityAsBool("is_smartphone"); line causes the exception
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
Posted: Fri Apr 17, 2015 5:13 pm
by Elliotfehr
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
Re: Version 1.6 capabilities
Posted: Tue Apr 21, 2015 12:30 pm
by denniskirk
Adding Virtual to my function calls solved my issue.